Sending email to multiple recipients from my vb.net application?
Hi,
I want to know if I can send an email to multiple recipients from my vb.net application with a send command button?
Please help me with the same!
Re: Sending email to multiple recipients from my6 vb.net application?
To specify multiple recipients for a MailMessage, simply separate each recipient with a semicolon. For example:
mail.To = "me@mycompany.com;him@hiscompany.com;her@hercompany.com";
The following code snippet demonstrates this technique.
Code:
Dim mail As New MailMessage()
mail.To = "me@mycompany.com;him@hiscompany.com;her@hercompany.com"
mail.From = "you@yourcompany.com"
mail.Subject = "this is a test email."
mail.Body = "this is my test email body."
SmtpMail.SmtpServer = "localhost" 'your real server goes here
SmtpMail.Send(mail)
Re: Sending email to multiple recipients from my6 vb.net application?
Use code something like
Code:
MailMessage msg = new MailMessage();
msg.To.Add(new MailAddress("blah1"));
msg.To.Add(new MailAddress("blah2"));
msg.To.Add(new MailAddress("blah3"));
Re: Sending email to multiple recipients from my6 vb.net application?
According to me here you will understand how to send the email to multiple recipients with a lot more options regarding emails from your vb.net program!
http://www.dotnetspider.com/resource...ine-Image.aspx
I hope this helps you!