Email Address: Password:
Create Account | Forgot Password?
Sales (206) 497-1149
Support Click Here

Portal Home > Knowledgebase > Email > Email Specifications > Send Email code for Asp.Net site


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();
System.Web.Mail.SmtpMail.SmtpServer="mail.websecurestores.com";
msgMail.To = "myemail@mydomain.com";
msgMail.From = "webmaster@WebSecureStores.com";
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;

SmtpMail.Send(msgMail);

Response.Write("Email was sent");
%>



Was this answer helpful?

Add to Favourites Add to Favourites    Print this Article Print this Article

Also Read
Bounced email policy (Views: 975)

Language: