Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 5175 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies
Posted

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

Posted

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

  • Newbies
Posted

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

Posted

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

  • Newbies
Posted

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

This topic is 5175 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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