Send Email code for Asp.Net site

Please save this code to your wwwroot folder as sendmail.aspx:
You need to change the usernames and smtp server name to be valid. Your welcome email has smtp and user information or contact us for your info.

<% @Page Language="C#" %>
<% @Import Namespace="System.Web.Mail" %>
MailMessage msgMail = new MailMessage();
msgMail.To = "";
msgMail.From = "";
msgMail.Subject = "This is test email";

msgMail.BodyFormat = MailFormat.Html;
string strBody = "<html><body><b>Hello World</b>" +
" <font color=\"red\">ASP.NET</font></body></html>";
msgMail.Body = strBody;


Response.Write("Email was sent");

  • 4 Users Found This Useful
Was this answer helpful?

Related Articles

Shared hosting email hard disk space

Shared hosting email plans have a default hard disk space of 1GB. Email hard disk space can be...

Bounced email policy

Our shared hosting plans have a policy for bounced, or undeliverable emails. We throttle email...

Shared hosting email maximum message size allowed

Shared hosting email plans allow you to send a maximum of 10MB per email. The 10MB limit includes...

Smarter Mail user password policy

The Smartermail email user password policy is in place to prevent Smartermail user email accounts...

Default email user box size

The default WebSecureStores email user box size is 200MB per user if you have a Helm account or...