Sending email to multiple recipient

I am trying to send emails to multiple recipient using the Send Mail Task, but it is failing with the error: "The specified string is not in the form required for an e-mail address." It works when I have only one emailID in the ToLine,

I have a script task that build the emaiID list and saves it in a variable and the in the Send Mail Task, I am using the Expressions for ToLine to use this variable. If there is just one emailID in the list, everything works, but if there are multiple, it throws an error.

For building the emailID list, I tried using "," as well as by ";". But none seem to work.

Any help will be greatly appreciated.



Answer this question

Sending email to multiple recipient

  • polsksm

    The Send Mail task likely doesn't support multiple recipients. So in adding multiple recipients to the task, the resulting string is getting sent as one "RCPT TO:" SMTP command. That's invalid. The Send Mail task would have to internally iterate through each entry and then send a RCPT TO: command for every recipient as part of the SMTP mail session.

    You can use distribution lists though. Perhaps you can set one of those up.


  • Grotius

    OK. Angle brackets are not needed, so ToLine can be: "Sender Name" sender@domain.com.



  • kevin D. white

    If you put the comma deliminated string in to "TO" of the Send mail task it sends it as 1 email, but if you create a variable and on run time build the values of that variable and use using expressions, specify that the "ToLine" should use this variable, it fails.
  • kinpin9

    For building the emailID list, I tried using "," as well as by ";". But none seem to work.

    It's interesting, because comma works for me fine - "aaa@zzz.com, bbb@zzz.com" sends proper mails. Is it possible that it depends on SMTP server.

    I also learn today that it is possible to specify name of the sender ie. "Name if Sender" followed by emaill address in angle brakets - I wish I could put an example, but this editor changes email address in angle brakets to the link... It also cannot properly handle HTML "& commands". *sigh*

    Juliusz



  • BeaverMan

    Hi there,

    It is possible to send mails to multiple recipients in ssis. For example, if you have a table called email which contains all the emails: It would look something like this way:

    column email

    a@hotmail.com --rows

    b@hotmail.com --rows

    c@hotmail.com --rows

    write a script in such a way that these 3 above records appear in such a way like:

    a@hotmail.com;b@hotmail.com;c@hotmail.com

    and then put this above value in a variable , this should work.

    Note: Make sure that you have a semi column in between each recipient and also make sure that the last recipient should not contain any semi column after the email address.


  • Sending email to multiple recipient