Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/fractur1/public_html/ on line 54
Project 602 - GoDaddy Email Class
Project 602
(Just another AZ Geek)
Home   |   Search   |   About   |   Contact
GoDaddy Email Class
Posted - Jun 20th, 2007 3:24pm
Share On Facebook! Share On Pintrest! Permalink
I have a few sites hosted on GoDaddy's virtual servers.  One of those is an 2.0 site which needed to send email from a web form.  Nothing too special but the new System.Net.Mail classes require you to specify your mail server and a few other options that I had to do some skulking around to figure out.

Microsoft saw fit to make this whole process overly complicated so here is a simple class that turns email into a single function deal.  For those of you who have 2.0 sites on GoDaddy's servers just toss the attached class into your App_Code directory and call it as follows:

Dim email As SimpleEmail

email = New SimpleEmail()

If email.sendEmail("", "", "", "Subject", "Message", True) = True Then
Response.Write("It Worked")
Response.Write("It didn't work and here is why: " & email.ErrorMessage()
End If

Just make sure you have at least 1 email account setup on your site before trying this or it won't work.  Thats all there is to it.
Comments (0)

No comments have been posted yet.
<-- Type: I am not a spambot
Copysomething © 20014