Thursday, August 13, 2009

Send Email using ASP from a Web Form in GoDaddy

I'm not really fond of GoDaddy, just like I'm not fond of WalMart, but I still shop there. When it comes to cheap hosting, especially in a combined ASP/PHP/.Net environment, they're pretty much it. For less than $10 a month I can get 25 MySQL databases, 5 SOL databases, and unlimited top level domains. Can't be beat, or at least I couldn't find a place to beat it after wasting about hours of my life looking around before picking GoDaddy as my solution.

So I've been moving some of my sites over. Why pay $5 a month (which is still cheap) when I can get hosting for pennies? I mean, $5 isn't much, but when you're hosting 11 sites, it adds up.

Many of the sites I host use contact forms or confirmation forms, or some other form that needs to send out an email. Simple enough, but I spent a good three hours this morning figuring out how to do it on GoDaddy, and not for the reason you think.....

Before I get to that, here's the code:

sendUrl="http://schemas.microsoft.com/cdo/configuration/sendusing"
smtpUrl="http://schemas.microsoft.com/cdo/configuration/smtpserver"

' Set the mail server configuration
Set objConfig = CreateObject("CDO.Configuration")
objConfig.Fields.Item(sendUrl) = 2 ' cdoSendUsingPort
objConfig.Fields.Item(smtpUrl) = "relay-hosting.secureserver.net"
objConfig.Fields.Update

' Create and send the mail
Set objMail=CreateObject("CDO.Message")

' Use the config object created above
Set objMail.Configuration = objConfig
objMail.From = "sender@coolexample.com"
objMail.To = "recipient@coolexample.com"
objMail.Subject = "subject"
objMail.TextBody = "body"
objMail.Send

Set objSendMail = Nothing
Set objConfig = Nothing

Replace the hardcoded values for subject, from, to etc. with your own values. Bear in mind GoDaddy will only send 250 messages a day, so if you need to do more, you'll have to come up with some other solution.

Now here's the kicker. Two kickers, really:

The first is GoDaddy doesn't allow detailed error messages for classic ASP. All you get is a 500 Internal Server Error. I wasted a good bit of the three hours trying to figure out how to turn on errors but came up with nada. So good luck troubleshooting your ASP code....

And this is related to the above: I couldn't get the damn thing to work (and I couldn't see the error). So I ended up stepping through it line by line and guess what the problem was?

GoDaddy doesn't allow you to use a GMail address as a from address.

That's right my friends, Read it again.

So say you have a site with some sort of Send to a Friend thing where you ask for the sender's email, so the message says something like YourFriend@HisEmail.com has sent you a link and the from address is actually the person's email.

Well, if your address happens to be a GMail (and maybe other free mail apps, I didn't check) you get an error. An error that you can't troubleshoot.

Once I figured that out, the code worked fine, although I had to update some of my forms to change the sent from value so it didn't use the submittor's email address anymore.

Monday, August 03, 2009

RetroWebDev's No Joke Guide to Making Money on the Internet - Part 1: Introduction

OK, this is it. I know, I know, there are a ton of guides out there, most of them wanting money and most of them promising financial independence and near-instant wealth. You too can earn $3,768.18 a day!

Well maybe you can, but if that's the type of program you're looking for, read no further, because that's not the type of program I'm going to talk about.

I'm talking about a real, working-as-I-type-this program that has, for the last year, earned me between $1,000 - $2,000 a month. At my peak in December 2005, I had over $10,000 in revenue and just over $9,000 in gross profit.

But that's another story, for another time, and in another time, before the search engines had their huge affiliate crackdown in early 2006 and I went from $300 a day to $30. Ouch! Good thing I hadn't quit my day job....

That's probably worth making a rule: Don't quit your day job.

The type of pay-per-lead and pay-per-sale marketing I'm talking about can be a finicky beast, with companies and offers and products coming in and out of the marketplace and marketing terms being changed all the time. Nothing hurts quite so bad as having a well performing offer pulled out from under you or the terms changed to prohibit your most profitable marketing channel, but it happens all the time, for any reason (or for no reason at all).

Example: In 2007 I was doing $5,000 a month of a very popular diet program, only to have the company change their affiliate terms to prohibit pay-per-click marketing, because--Iwas told--they felt I was stealing sales they would have been getting! Bye-bye $5k....

This isn't to say if you ever do reach $3,768.18 that you couldn't quit. If you did, and it was coming in spread acorss a large number of offers and sites, and you had been saving $3,468.18 a day (or more) for the last 6 months, you still need to work. In that case, you probably don't.

If you're still reading, I'll assume you aren't making anything, or at least not that much, and you want to know the secret. By the end of all this, I think you'll see this isn't much of a secret at all. It's a proven method (at least proven for me in that it works and I get checks), based on some pretty solid and repeatable actions.

In other words, anyone can do it. But there are some things you need to have in place before you can get started.

Stay Tuned for Part 2: What you Need to get Started