(Something about otters)
Welcome

GoDaddy Email Class  -  Jun 20th, 2007 3:24pm
 
I have a few sites hosted on GoDaddy's virtual servers.  One of those is an asp.net 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 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

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.


 
1KB
 

Comments

No comments have been posted yet.

Name
  (optional)
Comment
Anti-Spam

Type I am not a robot above



[ TAGS ]
- Code  (2)
- Gear  (4)
- Personal  (36)
- Signs  (3)
- Gaming  (2)
- Humor  (6)
- Fishing  (19)
- Food  (18)
- Politics  (1)
- Projects  (5)
- Travel  (17)
- Music  (6)
- Golf  (2)
- Activities  (25)




[ Eating ]
- The Arrogant Butcher - Phoenix, AZ
- Cornish Pasty Co - Chandler, AZ
- Lees Cream Liquer - Scottsdale, AZ
- Flancers - Gilbert, AZ




[ Listening To ]
- Toad The Wet Sprocket - The 90's live!
- The Appleseed Cast - Two Conversations
- The Get Up Kids - Live At Granada
- The Weakerthans - Listen to Aside
- The Faint - Wet From Birth
- Silversun Pickups - Caranvas




[ Watching ]
- Medium
- Lie To Me - Can you spot a lie?
- Thumbs Up America - A fantastic series
- Love Me If You Dare - Sooo messed up




[ Playing ]
- Final Fantasy V - (SNES)
- Sword And Sworcery - (iPad)
- Ticket To Ride - (Board)
- Settlers Of Catan - (Board Game)
- Cave Story - (PC)