I'm using an SSIS "Send Mail Task" in an attempt to send to multiple recipients. In the TO line of the editor, I have specified the value as follows:
Only the last email address in the semicolon seperated list receives the mail.
SMTP Server is Microsoft Exchange
I'm running SSIS 2008
I have confirmed that all individual address work when set as the sole value in the task editor settings.
The MSDN documentation states that multiple addresses in TO line is supported but I have not been able to get it to work as intended. Can someone help with what I am missing or is this a bug.
Aamir - There is not dot, its only: firstname.lastname@example.org;email@example.com
I've tested this with multiple recipient email accounts and the result is always the same in wchich the Email Task is only sending to the last email address in the ";" seperate list. Are the special settings on the SMTP server or on the task properties that are require for this to work?
I had been using Send mail task in SSIS 2005 and SSIS 2008, Never encounter this issue.
Are you using some variable in TOLINE (Expressions), might be email address get over write with only one value.
Please hard code the Two Email Address in TO and try again.
Are you able to CC to multiple Address or It behave the same way like TO?
What is the length or your two address? how many characters?
Please share your findings
I am running into a similar issue. I have defined a String package variable, EmailTo. The default value set in the package contains two email addresses, separated by a semicolon. When executed from Visual Studio, it runs without error. When I run the package from a command line, and pass the argument, /SET \PACKAGE.VARIABLES[User::EmailTo].PROPERTIES[Value];"firstname.lastname@example.org", it still works fine. However, as soon as I try to set the value to multiple recipients, each separated by a semicolon, similar to the value that I hard-coded in the package, I get the following error:
Warning: 2011-09-20 10:45:01.91
Source: Send Mail Task Send Mail Task
Description: The address in the "To" line is malformed. It is either missing the "@" symbol or is not valid.
Progress: 2011-09-20 10:45:01.91
Source: Send Mail Task
The SendMail task is initiated.: 0% complete
Error: 2011-09-20 10:45:01.93
Source: Send Mail Task Send Mail Task
Description: An error occurred with the following error message: "The specified string is not in the form required for an e-mail address.".
I tried replacing the semicolon with a comma. Received the same error. I still don't understand why the value passed in as a parameter behaves differently than the value entered in the variable definition in the package. I've been using command line parameters for several years with no problems for numbers, dates, guids, etc.
The correct syntax when using semi-colons (;) in set variable of DTExec (as far as I remember) is to surround the value in "" like
/SET \PACKAGE.VARIABLES[User::EmailTo].PROPERTIES[Value];""email@example.com; firstname.lastname@example.org"" or
/SET "\PACKAGE.VARIABLES[User::EmailTo].PROPERTIES[Value]";"""email@example.com; firstname.lastname@example.org""" (yes, triple quote)
Think is the ; after the [value] confuses DTExec
Arthur My Blog
- Proposed as answer by eguy66 Friday, November 30, 2012 5:15 PM
I had this problem also, I am using SQL 2008 R2 This only occured when there is a space after the (;) semi-colon and before the next email. e.g. An.Email@Home.com; An.Other@Email.com if you remove the space so that it is one complete string it should work. e.g. An.Email@Home.com;An.Other@Email.com Hope this helps.
- Proposed as answer by Noffie Thursday, May 16, 2013 4:37 PM
I have almost similar situation, I understand and works what you mentioned on Jan20, 2012 but in my case multiple addresses are assigned to 1 group email address.
As soon I use group email address, "Send Mail Task" doesn't send an email. I have too many addresses so I don't want to have hard corded values and it also gives us ability for not to change package if one or more address gets disable to need to add one or more.
The issue was the "group email id" which was provided by IT was kind of not right but right. I looked into this email addresses list in outlook/exchange address book for this group email id. There are tons of emails listed in "E-mail Addresses" tab. Somehow all the addresses should work but I tried the email with domain name preceded to "group email id" and it worked.
BTW, I did not have to list/specify the email addresses with ; or , because the email id itself is a group email id on exchange server and it's server level group email id which has many members.
Thank You and apologize for late notification but hope this helps. In short, the answer was in Outlook/Exchange and not in SSIS control(s).
- Proposed as answer by Jshop Wednesday, June 06, 2012 4:20 PM
I had this problem also, I am using SQL 2008 R2 This only occured when there is a space after the (;) semi-colon and before the next email. e.g. An.Email@Home.com; An.Other@Email.com if you remove the space so that it is one complete string it should work. e.g. An.Email@Home.com;An.Other@Email.com Hope this helps.Thank you. This was driving me nuts. A little white space can do that to a man I suppose.