I would think it's just a matter of setting the SmtpServer to the proper setting.
Code:
SmtpMail.SmtpServer = "mail.servername.com"
or maybe
Code:
SmtpMail.SmtpServer = "127.0.0.1"
I'm sure the experts here will be able to tell you if this is correct. You will of course need the proper permissions to send mail on the selected server.
I used to rock and roll every night and party every day. Then it was every other day. Now I'm lucky if I can find 30 minutes a week in which to get funky. - Homer Simpson
Sorry, my doubt is in our office we have two different domains, one is within india and other is international one. For each domains we have 2 different mailserver. How can i send email to both domains at a time without sendind seperately for each domain?
My post shows how to do that. In an email address, everything after the @ symbol is the domain. To send email to multiple domains, just separate the email address in the list by a semicolon.
I used to rock and roll every night and party every day. Then it was every other day. Now I'm lucky if I can find 30 minutes a week in which to get funky. - Homer Simpson
dim lacalmailserver as string="10.10.10.10"
dim to_add as string="abc&india.com;def@international.com"
Dim EmailServer As New System.Net.Mail.SmtpClient(LocalMailServer)
Dim myMessage As New System.Net.Mail.MailMessage(from_add, to_add, mail_subject, mail_body)
EmailServer.Send(myMessage)
myMessage = Nothing
I am using this procedure to send an emial. For @india.com we are using 10.10.10.10(example) and for international we are using 10.10.10.20.
In this context how can i send email to both email id's.
You would have to run your code again with the second server address. There is not a way to send email through (not to) multiple email servers at the same time.
And I'm done here.
I used to rock and roll every night and party every day. Then it was every other day. Now I'm lucky if I can find 30 minutes a week in which to get funky. - Homer Simpson
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.