Knowledgebase
Portal Home > Knowledgebase > Email > Using .NET 2.0 to send an email
Using .NET 2.0 to send an email
Here is some code that will accomplish this:
using System.Net.Mail;
System.Net.Mail.MailMessage msg = new System.Net.Mail.MailMessage();
msg.To.Add("test@your_domain.com");
msg.From = new MailAddress("test@your_domain.com", "Your Domain",
System.Text.Encoding.UTF8);
msg.Subject = "Test mail using .net2.0";
msg.SubjectEncoding = System.Text.Encoding.UTF8;
msg.Body = "This is my msg Body";
msg.BodyEncoding = System.Text.Encoding.UTF8;
msg.IsBodyHtml = false;
msg.Priority = MailPriority.High;SmtpClient client = new SmtpClient();
client.Host = "smtpmailer.hostek.net";client.Send(msg);
Add to Favourites Print this Article
* ASP is only available on Windows
Home Page |
||
* ASP is only available on Windows. |