cc or bcc with smtpsendmail

Ideas for new features & functions

Moderators: Dorian (MJT support), JRL

Post Reply
matthiasR
Pro Scripter
Posts: 52
Joined: Tue Jan 20, 2004 3:45 pm
Location: Lübbecke, Germany

cc or bcc with smtpsendmail

Post by matthiasR » Wed Nov 16, 2005 12:30 am

Hi,

are there any plans to include the possibility to send emails to cc or bcc recipients with smtpsendmail near future?

Regards,

Matthias

User avatar
jpuziano
Automation Wizard
Posts: 1085
Joined: Sat Oct 30, 2004 12:00 am

Post by jpuziano » Wed Nov 16, 2005 8:37 pm

Hi Support,

I agree, enhancing the SMTPSendMail command to be able to include cc and/or bcc recipients would be nice, great suggestion matthiasR. As well, I noticed in the Help File, it says:

recipients : Include one or more email addresses, separated by semicolons

I have a macro that uses a dialog, you enter recipient email addresses, enter message text, hit a Send button and it sends the email using SMTPSendMail. I've noticed that if I separate multiple recipients with semicolons like it suggests in the help, it doesn't work, only the first recipient gets the email.

However when I use commas (,) instead, all recipients get the email so that's what I do. I'm just wondering if the documentation should be changed or is there something more going on here?

Thanks
Last edited by jpuziano on Thu Nov 17, 2005 1:01 am, edited 1 time in total.
jpuziano

Note: If anyone else on the planet would find the following useful...
[Open] PlayWav command that plays from embedded script data
...then please add your thoughts/support at the above post - :-)

User avatar
support
Automation Wizard
Posts: 1450
Joined: Sat Oct 19, 2002 4:38 pm
Location: London
Contact:

Post by support » Wed Nov 16, 2005 9:15 pm

Can't be commas, that doesn't make sense! Commas are delimiters between parameters so commas would just cause an error or failure. recipients is first parameter of SMTPSendMail command. If you have three recipients separated by commas SMTPSendMail will think first one is recipients, second is server and third is from_address. You sure your dialog isn't replacing the commas with semicolons?

Will look into adding CC/BCC.
MJT Net Support
[email protected]

User avatar
JRL
Automation Wizard
Posts: 3501
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Wed Nov 16, 2005 10:36 pm

I've been using SMTPSendMail for a couple of years sending to multiple addresses using commas as the delimiter between email addresses. I define a variable "recip" and put it in the SMTPSendMail line. I think that SMTP requires addresses to be delimited by commas, regardless of whether the email is sent from Macro Scheduler or any other email program.

I agree bcc and cc would be welcome additions. Also, a while back, someone mentioned sending HTML emails. That also would be nice.

Thanks for listening,
Dick

User avatar
jpuziano
Automation Wizard
Posts: 1085
Joined: Sat Oct 30, 2004 12:00 am

Post by jpuziano » Wed Nov 16, 2005 10:43 pm

Hi Support,

I'm using variables for all SMTPSendMail parameters including recipients so embedded commas don't cause errors...

Let>recipients=[email protected],[email protected]
SMTPSendMail>recipients,server,me,myname,subject,body,attachment

To further test this, I removed the dialog and just left the bare minimum to send a test email. The only difference between tests is how the recipients string is built. Here's the results:

Let>recipients=[email protected],[email protected]
Comma with no space - Success, two emails sent

Let>recipients=[email protected], [email protected]
Comma with a space - Success, two emails sent

Let>recipients=[email protected];[email protected]
Semicolon with no space - Success, two emails sent

Let>recipients=[email protected]; [email protected]
Semicolon with a space - Failure, only first email sent :(
Success actually, but email came through late, delayed? :?:

:arrow: Update: When I got home, I checked the second email account again (Yahoo email) and found that all four tests did work... although the 4th one didn't show up right away (like the first three did).

I also noticed that even though the recipients string was different in each of the four tests, the To: field in Yahoo Email shows the two emails in the comma-space format like this:

To: [email protected], [email protected]

All four look exactly the same... is Yahoo enforcing this or is this a SMTPSendMail thing? I tried the same test just manually sending emails from the Yahoo and in all four cases, it converted the email separators to comma-space so I suppose Yahoo is doing this, but if they are, why? Is it "just for looks" to make all emails look similar or is it because comma-space is a more accepted email separator as far as Sendmail and SMTP goes? The following article seems to think so:

Separate Multiple Recipients Correctly (advocates comma)
http://email.about.com/cs/netiquettetips/a/et051101.htm

Using Google, I found 917 hits for:
"separate multiple recipients with a comma"

then again, there were 1,410 hits for:
"separate multiple recipients with a semicolon"

This article titled "VBScript does mail" says "Separate multiple recipients with a comma or semi-colon":
http://searchwinsystems.techtarget.com/ ... 43,00.html

RFC 821 - SIMPLE MAIL TRANSFER PROTOCOL -- is the standard
http://www.ietf.org/rfc/rfc0821.txt

...but in the RECIPIENT section, it doesn't stipulate a valid separator between multiple recipient email addresses, it just says this:

RECIPIENT (RCPT)

This command is used to identify an individual recipient of
the mail data; multiple recipients are specified by multiple
use of this command.

...so I suppose it is up to the software that talks to the SMTP server, to be able to parse a recipient string, separate individual emails and make multiple calls. I suppose any character/s not allowed as part of an email address would make good separators, comma and semicolon seem the most used. I found one article that said to use a space.

If anyone can shed more light here please do...

Many thanks to Support and all the knowledgeable contributors that make these forums well worth visiting.
Last edited by jpuziano on Thu Nov 23, 2006 6:36 am, edited 1 time in total.
jpuziano

Note: If anyone else on the planet would find the following useful...
[Open] PlayWav command that plays from embedded script data
...then please add your thoughts/support at the above post - :-)

User avatar
support
Automation Wizard
Posts: 1450
Joined: Sat Oct 19, 2002 4:38 pm
Location: London
Contact:

Post by support » Thu Nov 17, 2005 11:56 am

Hi,

I have just checked the code and I can see that semicolons OR commas are acceptable in the recipients list. So you can use either. Of course if the recipients are hardcoded into the command then you need to use semicolons, but you can use commas if you like when using a variable.

We are adding SMTP_CCLIST and SMTP_BCCLIST variables to version 8.
MJT Net Support
[email protected]

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