Knowledgebase: Script Mail
Sending E-Mail using ASP.Net (C# Example)
Posted by Paul Woodland on 30 September 2012 04:24 AM

If you are sending mail through ASP.Net on your website, you must use SMTP authentication through our Script Mail service, of which details can be found here:

ASP.Net includes built-in support for sending using SMTP authentication, no third party components are needed. The auth details can be set in web.config if you do not wish to include them in your code.

Example of sending email through ASP.Net using C#:

// Create the mail message
MailMessage mail = new MailMessage();

// Set the from address and to address
mail.From = new MailAddress("");

// Set the subject and body
mail.Subject = "Test Message";
mail.Body = "This is a test";

// Set the host, username and password
SmtpClient smtp = new SmtpClient(""); smtp.Credentials = new NetworkCredential("YOUR USERNAME", "YOUR PASSWORD"); 

// Send the message
(0 vote(s))
Not helpful

Comments (0)