Thread: Mailing Program
View Single Post
Old Aug 9th, 2007, 2:26 AM   #18
Bharathi
Programmer
 
Join Date: Apr 2005
Posts: 32
Rep Power: 0 Bharathi is on a distinguished road
Sending emails from ASP.Net page

Hi,

string sURL, sFullURL, sBody, URLText;

sURL = "http://www.jobssite.com/sitejob/ractken.aspx";
sFullURL = sURL + "?Code=" + sCode;
URLText = "Jobsken Site";

String displayResult = "Go to <A HREF=" + sFullURL + " >" + URLText + "</A>";
Response.Write(displayResult);

String strHTMLBody;

strHTMLBody = "<html><head><title>Confirm your registration.</title></head><body>Congratulations ! You have successfully completed registration.<br /><br />Now you need to confirm your registration.<br /><br />To confirm your registration, click on the link : <A HREF=" + sFullURL + " >" + URLText + "</A><br /><br />Regards,<br />From the team at Jobs.</body></html> ";


MailMessage oMessage = new MailMessage();
oMessage.Subject = "Confirm your registration. Jobs";
oMessage.Body = strHTMLBody;
oMessage.IsBodyHtml = true;
oMessage.From = new MailAddress("job@jobs.com");
oMessage.To.Add(new MailAddress(txtEmail.Text));
oMessage.Priority = MailPriority.High;

SmtpClient client = new SmtpClient("smtp.XXXXXX.com");

client.UseDefaultCredentials = true;
client.Send(oMessage);


Database programming using Visual Basic 2005
Bharathi is offline   Reply With Quote