Sunday, October 24, 2010

Send Email in dotnet c# and vb


this the easy code to send email with .net in windows application
this a c# code u can easy convert it to vb
System.Net.Mail.MailMessage message = new System.Net.Mail.MailMessage();
message.To.Add("Someone @microsoft.com");
message.Subject = "This is the Subject line";
message.From = new System.Net.Mail.MailAddress("From@online.microsoft.com");
message.Body = "This is the message body";
System.Net.Mail.SmtpClient smtp = new System.Net.Mail.SmtpClient("yoursmtphost");
smtp.Send(message)

No comments:

Post a Comment