|
GoDaddy Email Class - Jun 20th, 2007 3:24pm |
|
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 asp.net 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("from@x.com", "to@y.com", "reply_to@z.com", "Subject", "Message", True) = True Then
Response.Write("It Worked")
Else
Response.Write("It didn't work and here is why: " & email.ErrorMessage()
End If
email = New SimpleEmail()
If email.sendEmail("from@x.com", "to@y.com", "reply_to@z.com", "Subject", "Message", True) = True Then
Response.Write("It Worked")
Else
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.