Hi
What's the equivalent of smtpmail in vb.net 2005.
Its not valid (it has become obsolete)
Help needed please
What's the equivalent of smtpmail in vb.net 2005.
Its not valid (it has become obsolete)
Help needed please
private static void SendEmail(MailAddressCollection PMailTo, MailAddress PObjMailFrom, string PstrMessage, string PstrSubject) { string LstrSMTPHostName; MailMessage LobjMailMessage; SmtpClient LobjSmtpClient; // - Intialize the SMTP Client SmtpSection smtpSec = (SmtpSection)ConfigurationManager.GetSection("system.net/mailSettings/smtp"); LstrSMTPHostName = smtpSec.Network.Host; LobjSmtpClient = new SmtpClient(LstrSMTPHostName); LobjSmtpClient.UseDefaultCredentials = true; // - Initialize Mail Message LobjMailMessage = new MailMessage(); foreach (MailAddress MailAddress in PMailTo) { LobjMailMessage.To.Add(MailAddress); } LobjMailMessage.From = PObjMailFrom; LobjMailMessage.Subject = PstrSubject; LobjMailMessage.Body = PstrMessage; LobjSmtpClient.Send(LobjMailMessage); }
<system.net> <mailSettings> <smtp from=""> <network host="" password="" userName="" /> </smtp> </mailSettings> </system.net>
<system.net> <mailSettings> <smtp from=""> <network host="" password="" userName="" /> </smtp> </mailSettings> </system.net>
Comment