SMTPSendMail Adding an in-line comma

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
Tourless
Pro Scripter
Posts: 69
Joined: Wed Jun 14, 2017 1:53 am
Location: NY

SMTPSendMail Adding an in-line comma

Post by Tourless » Wed Jan 18, 2023 8:48 pm

Hi Folks,

I'm working on adding email directly from my macro and I want to add a comma in the HTML body. Currently I'm not able to get it to work in-line. If I say Let>body=Sincerely, and reference the variable it works. But if I try in the SMTPSendMail command directly it does not. I'm assuming it has something to do with the commas being separators for the various parts in the command. Can anyone tell me if there is a way to make this work or am I just out of luck? Here's my working v. non-working versions...

working...

Code: Select all

Let>SENDMAIL_STATUS=1
Let>SMTP_AUTH=1
Let>SMTP_SSL=1
Let>SMTP_USETLS=3
//Let>TLS_VER=12
Let>[email protected]
Let>SMTP_PASSWORD=hahaha
Let>SMTP_PORT=587
Let>SMTP_HTMLBODY=1
Let>body=Sincerely,
SMTPSendMail>[email protected],smtp.office365.com,[email protected],Server,Test,body,C:\Users\meDownloads\Report.pdf
Message>Result of SendMail: %SMTP_RESULT%
not working...

Code: Select all

Let>SENDMAIL_STATUS=1
Let>SMTP_AUTH=1
Let>SMTP_SSL=1
Let>SMTP_USETLS=3
//Let>TLS_VER=12
Let>[email protected]
Let>SMTP_PASSWORD=hahaha
Let>SMTP_PORT=587
Let>SMTP_HTMLBODY=1
SMTPSendMail>[email protected],smtp.office365.com,[email protected],Server,Test,<p>Please find the attached Report</p><p></p><p>Sincerely,</p><p></p>,C:\Users\me\Downloads\Report.pdf
Message>Result of SendMail: %SMTP_RESULT%

User avatar
Dorian (MJT support)
Automation Wizard
Posts: 1348
Joined: Sun Nov 03, 2002 3:19 am
Contact:

Re: SMTPSendMail Adding an in-line comma

Post by Dorian (MJT support) » Wed Jan 18, 2023 9:22 pm

Commas separate parameters, so it sees whatever is after the comma as the next parameter. This is a large part of the reason we have the %comma% system variable.

Try this :

Code: Select all

Sincerely%comma%</p>

Code: Select all

SMTPSendMail>[email protected],smtp.office365.com,[email protected],Server,Test,<p>Please find the attached Report</p><p></p><p>Sincerely%comma%</p><p></p>,C:\Users\me\Downloads\Report.pdf
Yes, we have a Custom Scripting Service. Message me or go here

Tourless
Pro Scripter
Posts: 69
Joined: Wed Jun 14, 2017 1:53 am
Location: NY

Re: SMTPSendMail Adding an in-line comma

Post by Tourless » Wed Jan 18, 2023 9:27 pm

Perfect, thank you very much! I had a feeling there was a way to handle it properly. I tried combinations of single and double quotes thinking perhaps that was the solution to my problem. Is there a list of these system variables compiled somewhere for reference?

User avatar
Dorian (MJT support)
Automation Wizard
Posts: 1348
Joined: Sun Nov 03, 2002 3:19 am
Contact:

Re: SMTPSendMail Adding an in-line comma

Post by Dorian (MJT support) » Wed Jan 18, 2023 10:03 pm

Always happy to help.

You'll find them after the list of commancds in the Command Reference, and searching for "system variables" in the manual. The latter has better explanations.
Yes, we have a Custom Scripting Service. Message me or go here

Post Reply
cron
Sign up to our newsletter for free automation tips, tricks & discounts