Step 1: Create a Message object First, insert the appropriate “using” statement:
using System.Web.Mail;
Next, create a new Message object like so:
MailMessage msg = new MailMessage();
Step 2: Populate the message properties Now, set the message properties:
msg.To = sTo;
msg.From = sFrom;
msg.Subject = sSubjecct;
msg.Body = sBody;
Step 3: Set the SMTP server and send the message You’ll send the message [...]
Posts Tagged ‘sending email in .net’
Sending eMail with dotNET
Posted in .Net Articles, ASP.Net, C#, tagged C#, sending email in .net on July 23, 2008 | Leave a Comment »