Using CDOSYS to Send Email especially for Godaddy

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
Submitted byAnonymous (not verified)on Sat, 01/16/2010 - 16:17

Thanks man!! Your solution works. I was trying from last 4 hours for this. But after using your method, problem is solved. Keep doing good work !!!!
Submitted byAnonymous (not verified)on Wed, 09/08/2010 - 19:48

Hi Good code!!!!!!!!!!, i have written same code and working for one website but when i developed another web site the same code not working, it is giving me error i.e. security error . i have hosted two web sites on different domains in godady.
Submitted byAnonymous (not verified)on Tue, 03/29/2011 - 18:18

its not working. i write that code, its in vb.net ------------ Dim SERVER As String = "relay-hosting.secureserver.net" Dim oMail As New System.Web.Mail.MailMessage oMail.From = "[email protected]" oMail.To = emailTo oMail.Subject = "Test email subject" oMail.BodyFormat = MailFormat.Html oMail.Priority = Mail.MailPriority.High oMail.Body = "Sent at: " + DateTime.Now SmtpMail.SmtpServer = SERVER SmtpMail.Send(oMail) Response.Write("donnnnn") oMail = Nothing ------------------------------------ if any thing wrong please tell me.... thank you

Add new comment