I have smtp email functionality. it works for single address but has problem in multiple address.
i am passing multiple addresses using following line of code.
MailAddress to = new MailAddress("abc@gmail.com,xyz@gmail.com");
Please let me know the problem as i am not getting any error.
I'm used "for" operator.
StewieFG suggestion is valid but if you want to add the recipient name use this, with what Marco has posted above but is email address first and display name second:
try this..
To
is aMailAddressCollection
, so you can add how many addresses you need.If you need a display name, try this:
My code to solve this problem: