Using CDOSYS to Send Email especially for Godaddy

Submitted by planetsourcecode on
Here is the code to send Email from your website.I had tested this code on My Godaddy Web hosting and it was perfectly working. The things need to be change is in Red colour // language -- C# // import namespace using System.Web.Mail; private void SendEmail() { // Don't change this if you are using godaddy otherwise mention your smtp server name. const string SERVER = "relay-hosting.secureserver.net"; MailMessage oMail = new System.Web.Mail.MailMessage(); oMail.From = "emailaddress@domainname"; oMail.To = "emailaddress@domainname"; oMail.Subject = "Test email subject"; oMail.BodyFormat = MailFormat.Html; // enumeration oMail.Priority = MailPriority.High; // enumeration oMail.Body = "Sent at: " + DateTime.Now; SmtpMail.SmtpServer = SERVER; SmtpMail.Send(oMail); oMail = null; // free up resources } Note : plaese include the System.Web.Mail namespace in the header section of your asp.net page About the author: PlanetSourceCode.in is a place for all developer providing free source codes, articles, MCA complete projects,complete application in PHP, C/C++, Javascript, Visual Basic, Cobol, Pascal, ASP/VBScript, AJAX, SQL, Perl, Python, Ruby, Mobile Development