Hosting Knowledge ASP.Net - Send Email Using System.Web.Mail Class
SocialTwist Tell-a-Friend
Advertisement

ASP.Net - Send Email Using System.Web.Mail Class

Here is a small script that actually send emails using asp.net sytem.webmail class:

<% @Page Language="C#" %>
<% @Import Namespace="System.Web.Mail" %>
<%
MailMessage msgMail = new MailMessage();
msgMail.To = "Recipient Email Address";msgMail.From = "Sender’s email address";
msgMail.Subject = "Subject of an email";
msgMail.BodyFormat = MailFormat.Text;
msgMail.Body = "Body contents";
msgMail.Attachments.Add(new MailAttachment("c:\\shane.xls"));
SmtpMail.Send(msgMail);
Response.Write("Email has been sent");
%>

Enjoy ASP.NET coding !!!

Rate This Article


  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
poorGreat

Add comment


  • Your name :
  • Email :
  • *Comment :
  • Word Verification

Web Hosting Directory

  • The web hosting directory is for anyone who is searching for website hosting and hosting related resources. The directory is listing Shared, VPS and Dadicated server plans in descending order for customer ratings !!! This web hosting directory is listing plans on the basis of 100% unbiased customer ratings. TheWebHostingDir.com provides you nice tool to easily search all types of web hosting plans including cheap web hosting, ASP.Net hosting, php mysql hosting, Cheap VPS Hosting, Windows VPS, HyperV VPS, Xen VPS and Cpanel VPS Hosting.



Quick search

Request a Quote

If you wish to receive proposals from Web Hosting Companies Suited to your needs.