• We just launched and are currently in beta. Join us as we build and grow the community.

Using CDOSYS to Send Email especially for Godaddy

reloblo

Ad Clickthrough Pro
R Rep
0
0
0
Rep
0
R Vouches
0
0
0
Vouches
0
Posts
71
Likes
159
Bits
2 MONTHS
2 2 MONTHS OF SERVICE
LEVEL 1 300 XP
Submitted by
planetsourcecode

on
Fri, 07/10/2009 - 02:49

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

codes starts here
// 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
}

codes ends here
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

 

440,010

316,559

316,568

Top