Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

My Script Sends Two Messages to Each Recipient

Featured Replies

  • Newbies

I'm using the SMTPit Send script (which I've adapted for my own database) and it now sends two messages every time. We were on FMP Server 5.5 and User 6.0 and it worked just fine, but I've upgraded both the server and user, as well as the plug-ins and updated the script, but it keeps sending two messages for every time I try to send one message.

I'm not sure where the problem is, but I suspect it's in the 'Setup Result' field.

Following is the setup result:

SMTPit_Clear & "¶" &

SMTPit_SetHost( Activities::SMTP Host ) & "¶" &

SMTPit_SetAuthentication( Activities::Authentication Type ; Activities::User Name ; Activities::Password ) & "¶" &

SMTPit_SetFrom( Activities::From Email Address ) & "¶" &

SMTPit_SetTo( Activities::To Email Address ) & "¶" &

SMTPit_SetCC( Activities::CC Email Address ) & "¶" &

SMTPit_SetSubject( Activities::Subject ) & "¶" &

SMTPit_SetPriority( Activities::Priority ) & "¶" &

SMTPit_SetAttachment( Activities::MyEmailAttachment) & "¶" &

SMTPit_SetBody( Activities::Body ) & "¶" &

SMTPit_SetBodyFooter( Activities::Text Signature ) & "¶" &

SMTPit_Send( Activities::Send Result )

I don't have any addresses in the CC recipients field, so I don't see how it could be that, but I don't even know where to look to find out why it's automatically sending two messages for every Send.

Any ideas would be greatly appreciated!

Debra

Hello Debra ,

What does the rest of your script look like? When in the Manage Scripts window, you can select your script, click the printer icon, and then select the PDF menu to print the script to a PDF.

Also, if you try creating a new test script, does it send multiple emails? For example, you could create a new script with a single Set Field script step. Set the Target field to your result field, and then use the following as the calculated result.

SMTPit_Clear & "¶" &

SMTPit_SetHost( Activities::SMTP Host ) & "¶" &

SMTPit_SetAuthentication( Activities::Authentication Type ; Activities::User Name ; Activities::Password ) & "¶" &

SMTPit_SetFrom( Activities::From Email Address ) & "¶" &

SMTPit_SetTo( Activities::To Email Address ) & "¶" &

SMTPit_SetSubject( Activities::Subject ) & "¶" &

SMTPit_SetBody( Activities::Body ) & "¶" &

SMTPit_Send

  • Author
  • Newbies

I can't thank you enough for your help! I'm completely stumped. I tried replacing the setup part of the script with your simple version and it still sends two copies.

I've attached the PDF of the entire script (thanks for the instructions) so I'm hoping you might be able to see what's making it send two messages every time. I am going to be using this to send individual messages to a large group of people with an attachment, so I need this script to work!

Thanks again for your help!

Mail_Script.pdf

It looks like the script is sending two emails because it is calling the SMTPit_Send function twice. Take a look at the calculation of the first Set Field, which looks like:

SMTPit_SetHost( Activities::SMTP Host ) & "¶" &

SMTPit_SetAuthentication( Activities::Authentication Type ; Activities::User Name ; Activities::Password ) & "¶" &

SMTPit_SetFrom( Activities::From Email Address ) & "¶" &

SMTPit_SetTo( Activities::To Email Address ) & "¶" &

SMTPit_SetCC( Activities::CC Email Address ) & "¶" &

SMTPit_SetSubject( Activities::Subject ) & "¶" &

SMTPit_SetPriority( Activities::Priority ) & "¶" &

SMTPit_SetAttachment( Activities::MyEmailAttachment) & "¶" &

SMTPit_SetBody( Activities::Body ) & "¶" &

SMTPit_SetBodyFooter( Activities::Text Signature ) & "¶" &

SMTPit_Send( Activities::Send Result ) ]

The last line of the calculation is the Send function which makes the plug-in actually send the email.

Now take a look at the 2nd Set Field of the script and view its calculation:

SMTPit_Send( Activities::Transcript ) & "¶¶"

This also includes the SMTPit_Send function, which is where the 2nd email is coming from.

To fix this, remove the Send function from the 1st Set Field script step. Again, it currently looks like:

SMTPit_SetHost( Activities::SMTP Host ) & "¶" &

SMTPit_SetAuthentication( Activities::Authentication Type ; Activities::User Name ; Activities::Password ) & "¶" &

SMTPit_SetFrom( Activities::From Email Address ) & "¶" &

SMTPit_SetTo( Activities::To Email Address ) & "¶" &

SMTPit_SetCC( Activities::CC Email Address ) & "¶" &

SMTPit_SetSubject( Activities::Subject ) & "¶" &

SMTPit_SetPriority( Activities::Priority ) & "¶" &

SMTPit_SetAttachment( Activities::MyEmailAttachment) & "¶" &

SMTPit_SetBody( Activities::Body ) & "¶" &

SMTPit_SetBodyFooter( Activities::Text Signature ) & "¶" &

SMTPit_Send( Activities::Send Result ) ]

Change it to this:

SMTPit_SetHost( Activities::SMTP Host ) & "¶" &

SMTPit_SetAuthentication( Activities::Authentication Type ; Activities::User Name ; Activities::Password ) & "¶" &

SMTPit_SetFrom( Activities::From Email Address ) & "¶" &

SMTPit_SetTo( Activities::To Email Address ) & "¶" &

SMTPit_SetCC( Activities::CC Email Address ) & "¶" &

SMTPit_SetSubject( Activities::Subject ) & "¶" &

SMTPit_SetPriority( Activities::Priority ) & "¶" &

SMTPit_SetAttachment( Activities::MyEmailAttachment) & "¶" &

SMTPit_SetBody( Activities::Body ) & "¶" &

SMTPit_SetBodyFooter( Activities::Text Signature )

Thanks,

Daniel

  • Author
  • Newbies

Hi Daniel:

YOU ARE MY HERO!!! You solved the problem! Now I see where I had grabbed the pre-set script and just put it into my existing script without noticing that it had the Send request in that step. I have taken it out and it now works perfectly!

I CANNOT THANK YOU ENOUGH!!! You are my savior today, so sit back while I fan you and feed you virtual grapes...!

Have a great day, Debra

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.