Remember those lazy days when you could kick your trustworthy CDONTS mail messages from anywhere inside juicy spaghetti code and it just worked? Well, those days are over. Even 1.x’s System.Web.Mail – also not a brainier to use – is outdated and big no-no our days.

Now we supposed to use SMTPW. And sometimes this beast just refuses to cooperate. Complete showstopper. I’m not a quitter, but I’m not going to spend countless hours googling around for the fix either (although, I admit, it is kind of addictive). So after short hunt, when first four or five “guaranteed” solutions did not work out I started looking for workaround.

Because I’m using GoDaddy, first I looked what they have to offer. Found another SMTP “solution” – nope, did not work either. Then there is a strange animal called “Form Mailer” – forums insisted that it is “classic” ASP only and does not work with ASP.NET. Fine. Or does it? I gave it a try. One of those days, I guess – everything is upside down. It worked. So, if you are in the same hole I’ve been for a while, there is how you can make GoDaddy send your emails (yes, even if your account .NET 2.0 only).

 

  1. Go to GoDaddy’s hosting account / control panel / content / form mail. Fill in email address you want “daddy” send your messages to and “enable” form mailer. It is simple wizard; all you need is to click “ok” couple times.
  2. GoDaddy will generate gdform.asp and put it in the root of your hosting account. The whole purpose of this .asp page is to parse form that invoked it and write data to the file. This file then will be picked up by scheduled job that will actually create and send email to address that you’ve set up in the step one.
  3. There are defined field names (or query string parameters) that you have to use. Sure, you can also change .asp script itself to use other names if you already have contact form in your application that you want to use, all you need is to submit form to gdform.asp. So, simple HTML form shown below will work just fine:

That’s it. You don’t have to set SSL, make sure your host port is not blocked by firewall, no configuring POP accounts, sending passwords back and force, adding stuff to your web.config and thousand other neat details that make SMTP look like can of worms. Ok, it may be a bit of a hack and security is somewhat questionable, may be. But till all that SMTP mess is fixed or dumbed down to my level – I’m going to use this one! Oh, and you don’t really have to use HTML page at all – you can even “send” mail this way from your business class, using ASP.NET request object. Although that will be a little bit more involving.

Signature

Related posts

Comments

12/25/2007 7:13:41 AM

Hi,
I am new to ASP.net world. My site is developed in ASP.net and not in HTML. please tell me what I need to do.

cheers,
Ajay

Ajay

12/25/2007 8:34:25 AM

Depends on your situation. Are you using existing application? Writing from scratch? What did you try so far?

rtur.net

2/20/2008 10:25:40 AM

maybe you are interested in my found solution
http://adrianvintu.com/blogengine/post/Send-mail-with-GoDaddy-and-Send-mail-with-BlogEnginenet.aspx

@out of the context:
do you have a spell check plug in for your BlogEngine.NET?

Adrian Vintu

2/21/2008 4:41:47 AM

maybe you are interested in my found solution
Actually, the very next post (just hit "SMTP with GoDaddy" link on top of this page) describes this same solution.
Spell checker should be for Tiny MCE if you are using default BE installation, not sure if there is one. Or you can use spell checker build into FireFox.

rtur.net

2/21/2008 6:33:31 AM

the funny thing is that I browsed a little bit your web, but did not see the linkSmile)

thanks for the tips on the spell check. I have no spell checking in my default BlogEngine installation and also the FF one is not working - I am talking about writing threads in my blog, not comments. for comments the FF works great, as usual. mystery...

cheersSmile

Adrian Vintu

Adrian Vintu

4/11/2008 9:03:33 PM

I have 5 websites that are in 1 hosting area on GoDaddy.
How do I setup the GDform.asp so it can retrieve mutiple e-mail accounts from different domain names. Working with just one domain name in the hosting this can be done but what about if I have more then one. I know the below gdform.asp and html file needs to be in each different domain folder so this will work. I have no ideal on how to figure this one. NEED HELP>>>



<html>
<head>
<title>My Site</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
<form action="gdform.asp" method="post">
<input type="hidden" name="subject" value="Form Test Submission">
<input type="hidden" name="redirect" value="thankyou.html">
<input TYPE="text" size="25" name="FistName">

<br>
<input TYPE="text" size="25" name="LastName">

<br>
<input TYPE="text" size="25" name="email">

<br>
<textarea name="comments" cols="40" rows="10"></textarea>
<input name="submit" type="submit" value="submit">
</form>

</body>
</html>
________________________________________________________________

this is godaddys gdform.asp


<%

Dim landing_page, host_url
Dim fso, outfile, filename, dirname, myFolder
Dim req_method, key, value
Dim bErr, errStr, bEmpty
On Error resume next
bErr = false
bEmpty = true
errStr = ""
Set fso = Server.CreateObject("Scripting.FileSystemObject")
host_url = Request.ServerVariables("HTTP_HOST")
req_method = Request.ServerVariables("REQUEST_METHOD")
dtNow = Now()
filename = Server.MapPath("ssfm")
dirname = filename
filename = filename & "/gdform_" & DatePart("M", dtNow) & DatePart("D", dtNow) & DatePart("YYYY", dtNow) & DatePart("N", dtNow) & DatePart("S", dtNow)

Function FormatVariableLine(byval var_name, byVal var_value)
Dim tmpStr
tmpStr = tmpStr & "<GDFORM_VARIABLE NAME=" & var_name & " START>" & vbCRLF
tmpStr = tmpStr & var_value & vbCRLF
tmpStr = tmpStr & "<GDFORM_VARIABLE NAME=" & var_name & " END>"
FormatVariableLine = tmpStr
end function

Sub OutputLine(byVal line)
outfile.WriteLine(line)
end sub

if err.number = 0 then
Set outfile = fso.CreateTextFile(filename, true, false)
if err.number <> 0 then
bErr = true
errStr = "Error creating file! Directory may not be writable or may not exist.<br>Unable to process request."
else
if(req_method = "GET") then
for each Item in request.QueryString
if item <> "" then
bEmpty = false
key = item
value = Request.QueryString(item)
if(lcase(key) = "redirect") then
landing_page = value
else
line = FormatVariableLine(key, value)
Call OutputLine(line)
end if
end if
next
elseif (req_method = "POST") then
for each Item in request.form
if item <> "" then
bEmpty = false
key = item
value = Request.form(item)
if(lcase(key) = "redirect") then
landing_page = value
else
line = FormatVariableLine(key, value)
Call OutputLine(line)
end if
end if
next
end if
outfile.close
end if
if(bEmpty = true) AND errStr = "" then
bErr = true
errStr = errStr & "<br>No variables sent to form! Unable to process request."
end if
if(bErr = false) then
if (landing_page <> "") then
response.Redirect "http://" & host_url & "/" & landing_page
else
response.Redirect "http://" & host_url
end if
else
Response.Write errStr
end if
set fso = nothing
else
Response.Write " An Error Occurred creating mail message. Unable to process form request at this time."
end if
%>

Gary

4/13/2008 2:17:04 PM

Gary, not sure if I follow your situation. Do you want mail go to 5 different mail boxes? Then you'll have set up 5 email accounts with GoDaddy and have gdform.asp in the root of every domain you are using. If you have only one account you might try to configure redirect in the mail section in GoDaddy admin, although I never tried it so it is just a guess.

rtur.net

6/6/2008 9:54:59 AM

Ok call me stupid. I have been "trying" to put a form on my page for weeks now. I have read and re-read godaddy's instructions on the gdform.asp. I even called godaddy and actually I didn't get much help. I read in your post (October 10 - Make godaddy send your mail, that godaddy places or generates the gdform.asp into the root..is that right? I don't see it. Am I suppose to see it? I just don't get it. I set up my email. I did what the instructions said and I get a big ole "Opps!"

This is my first time using godaddy, in the past I have had all my hosting with Yahoo. And I am sure the code I used for Yahoo would be similar to what godaddy offers. (meaning placing a code into the form and having it directed through e-mail)

All I want to be able to do is having my customers be able to fill out forms. That's all I want. I am by no means and idiot, I am by no means an expert at codes and all that but I am usually able to understand really quick about this stuff. And I just don't get it.

Is the gdform.asp suppose to be something they place into my root directory? Am I suppose to place it in there myself? I know for my menu bars there was a script page specfically for my menu bar, and it's all just code, is that what the gdfrom is suppose to be like? (Not sure if that makes any sense.) are viewers suppose to go directly to for example. www.yourpage/gdforms.asp?

I hope this is making some sort of sense to someone. Any help would be greatly appreciated

Adrienne

6/6/2008 11:21:27 AM

Adrienne,
GoDaddy will generate and put this little gdforms.asp file in your app's root directory after you go through step 1 of this post. Yes, it is just code - you can't go to this page and see any fields you need to fill up. For this to work, you actually need to create input form yourself like this:
1. Make sure you got step 1 right and have gdforms.asp in you site's root directory. You'll have to go to admin console and look at the list of files, going to "gdforms.asp" won't do it.
2. Create file "contact.htm", type in code shown in the picture and put it in the root of your site.
3. Go to "yoursite/contact.htm", you'll see a form with fields.
4. Type in a message and click "submit" button.
5. Email will be sent to the address you specified when you set up your "Form Mail", as described in the step 1.

rtur.net

6/7/2008 10:43:48 PM

Thanks so much I figured it out late last night. I started over (setting up the e-mail) and it worked like a charm. Before I did not see the coding but once I redid the e-mail steps it showed up right away. And was able to get the forms working.

Thanks for the response.

Adrienne

Adrienne

Add comment


 

  Country flag

biuquoteimg
Loading



<<  July 2008  >>
SuMoTuWeThFrSa
293012345
6789101112
13141516171819
20212223242526
272829303112
3456789
Enhanced with Snapshots

Subscribe to Rtur.net