Sending e-mail with ASP.NET
Bookmark this page Print this page
Article Applies To: ASP Plus, ASP Ultimate and Windows Reseller packages

Operating Platform
This article applies to Windows hosting accounts only.

Listed below is a simple example showing how to send email using ASP.NET: -

<% @Page Language="C#" %>
<% @Import Namespace="System.Web.Mail" %>

string strTo = "";
string strFrom = "";
string strSubject = "Test message";

SmtpMail.SmtpServer = "localhost";
SmtpMail.Send(strFrom, strTo, strSubject,"Hello, this is a test message.");

Response.Write("Email successfully sent");

Last Modified: 16/03/2011
© 2004 - 2015 Storm Internet Ltd