Nicole Henningsen's Blog
Posted At : February 1, 2008 12:10 PM | Posted By : Nicole Henningsen

Go Daddy ASP CDONTs form mail issue CONTINUED

I have received a lot of emails on the go daddy form mail issue. I have written an example to post for everyone that should help you out in a little more detail. This is a very raw form but it has been tested and it does work.

Below you will find an example of a very basic form for an estimate. This form will collect the data and post to a page called start_thanksN.asp. So you will need to start out by creating a blank HTML page (or whatever language you decide to use). You will enter your form data and post the data to your processing page. For this example I am posting mine to start_thanksN.asp.

<html>
<head>
<title>Example for submit using ASP and Cdont</title>
</head>

<body>
<table width="100%" border="0" cellspacing="2" cellpadding="0">
   <tr>
   <td width="94%" valign="top">
       <form name="form1" method="post" action="start_thanksN.asp" onSubmit="return checkForm()">
    <input type="hidden" name="recipients" value="YOUR EMAIL ADDRESS">
<input type="hidden" name="subject" value="Form Submission">
<input type="hidden" name="redirect" value="thankyou.html">
<table width="60%" border="0" align="center" cellpadding="2" cellspacing="0">
    <tr valign="top">
    <td width="27%" nowrap><div align="right"><font size="2">Name:</font></div></td>
<td width="73%"><div align="left"><input name="txtName" type="text" id="txtName12" size="30"></div></td>
</tr>
<tr valign="top">
   <td nowrap><div align="right"><font size="2">Address:</font></div></td>
<td><div align="left"> <input name="txtAddress" type="text" id="txtAddress2" size="30"></div></td>
</tr>
<tr valign="top">
<td nowrap><div align="right"><font size="2">City:</font></div></td>
<td><div align="left"><input name="txtCity" type="text" id="txtCity2" size="30"></div></td>
</tr>
<tr valign="top">
<td nowrap><div align="right"><font size="2">State:</font></div></td>
<td><div align="left"><input name="txtState" type="text" id="txtState2" size="30"></div></td>
</tr>
<tr valign="top">
<td nowrap><div align="right"><font size="2">Zip:</font></div></td>
<td><div align="left"><input name="txtZip" type="text" id="txtZip2" size="15"></div></td>
</tr>
<tr valign="top">
<td nowrap><div align="right"><font size="2">Phone:</font></div></td>
<td><div align="left"><input name="txtPhone1" type="text" id="txtPhone12" size="30"></div></td>
</tr>
<tr valign="top">
<td nowrap><div align="right"><font size="2">Alternate Phone:</font></div></td>
<td><div align="left"><input name="txtPhone2" type="text" id="txtPhone22" size="30"></div></td>
</tr>
<tr valign="top">
   <td nowrap><div align="right"><font size="2">Best Time to Call:</font></div></td>
<td><div align="left"><font size="2"><input name="chkMorning" type="checkbox" id="chkMorning" value="Morning">Morning
<input name="chkAfternoon" type="checkbox" id="chkAfternoon" value="Afternoon">Afternoon <br>
<input name="chkEvening" type="checkbox" id="chkEvening" value="Evening">Evening
<input name="chkAny" type="checkbox" id="chkAny" value="Any Time">Any Time </font></div></td>
</tr>
<tr valign="top">
   <td nowrap><div align="right"><font size="2">Email Address:</font></div></td>
<td> <div align="left"><input name="txtEmail" type="text" id="txtEmail" size="30"></div></td>
</tr>
<tr valign="top">
   <td nowrap><div align="right"><font size="2">Service Type:</font></div></td>
<td nowrap><div align="left"><input name="chkDesign" type="checkbox" id="chkDesign" value="Design">
<font size="2">Design</font><font size="2">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input name="chkNet" type="checkbox" id="chkNet" value="Net">
. Net<br>
<input name="chkColdFusion" type="checkbox" id="chkColdFusion" value="ColdFusion">
ColdFusion
<input name="chkPHP" type="checkbox" id="chkPHP" value="PHP">
PHP <br>
<input name="chkFlex" type="checkbox" id="chkFlex" value="Flex">
Flex<br>
<input name="chkASP" type="checkbox" id="chkASP" value="ASP">
ASP
<br>
                              <input name="chkDev" type="checkbox" id="chkDev" value="Development">
                              Development<br>
</font></div></td>
</tr>
<tr valign="top">
<td nowrap><div align="right"><font size="2">Current Site URL:</font></div></td>
<td><div align="left"><input name="txtURL" type="text" id="txtURL" size="45">
</div></td>
</tr>
<tr valign="top">
<td nowrap><div align="right"><font size="2">Message:</font></div></td>
<td><div align="left"><textarea name="txtMessage" cols="30" rows="4" id="txtMessage"></textarea></div></td>
</tr>
</table>
<div align="center"><br><input type="submit" name="Submit" value="Submit"><br></div>
         </form>
    </td>
    </tr>
</table>
</body>
</html>
Now that we have our form created we need to post our form to our processing page. You will need to create a blank .ASP page. The page should be the same name as your post in your form tag in your html page. This is where we will place all of our CDONTs code and post a confirmation that the email was sent.

<%@ LANGUAGE = VBScript %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Thank you</title>

<%
Dim theName
theName = request("txtName")
Dim theAddress
theAddress = request("txtAddress")
Dim theCity
theCity = request("txtCity")
Dim theState
theState = request("txtState")
Dim theZip
theZip = request("txtZip")
Dim thePhoneNum
thePhoneNum = request("txtPhone1")
Dim thePhoneNum2
thePhoneNum2 = request("txtPhone2")
Dim callTimeMorning
callTimeMorning = request("chkMorning")
Dim callTimeAfternoon
callTimeAfternoon = request("chkAfternoon")
Dim callTimeEvening
callTimeEvening = request("chkEvening")
Dim callTimeAny
callTimeAny = request("chkAny")
Dim theEmail
theEmail = request("txtEmail")
Dim serviceDesign
serviceDesign = request("chkDesign")
Dim serviceNet
serviceNet = request("chkNet")
Dim serviceColdFusion
serviceColdFusion = request("chkColdFusion")
Dim serviceFlex
serviceFlex = request("chkFlex")
Dim serviceRaking
serviceRaking = request("chkRaking")
Dim serviceASP
serviceASP = request("chkASP")
Dim servicePHP
servicePHP = request("chkPHP")
Dim serviceDev
serviceDev = request("chkDev")
Dim siteURL
siteURL = request("txtURL")
Dim theMessage
theMessage = request("txtMessage")

if not theName = "" then
'sends email to myself

Set myMail=CreateObject("CDO.Message")
myMail.Subject="Testing CDO form mail by Nicole Rutter"
myMail.From=theEmail
myMail.To="nicole@cfwebtools.com"
BodyText = "*********** Request For Estimate ***************" &chr(13) &chr(10)

BodyText = BodyText & "Name: " & theName &chr(13) &chr(10) & "Address: " & theAddress &chr(13) &chr(10) & "City: " & theCity &chr(13) &chr(10) & "State: " & theState &chr(13) &chr(10) + "Zip Code: " & theZip &chr(13) &chr(10)

BodyText = BodyText & "Phone Number: " & thePhoneNum &chr(13) &chr(10) & "Alternate Phone Number: " & thePhoneNum2 &chr(13) &chr(10) & "Best Time to Call: " & callTimeMorning & " " & callTimeAfternoon & " " & callTimeEvening & " " & callTimeAny &chr(13) &chr(10)& "Email Address: " & theEmail &chr(13) &chr(10) &chr(13) &chr(10) & "Services Requested: " &chr(13) &chr(10)
Dim ServiceRequest
if not serviceDesign = "" then
ServiceRequest = serviceDesign &chr(13) &chr(10)
end if
if not serviceNet = "" then
ServiceRequest = ServiceRequest + serviceNet &chr(13) &chr(10)
end if
if not serviceColdFusion = "" then
ServiceRequest = ServiceRequest + serviceColdFusion &chr(13) &chr(10)
end if
if not serviceFlex = "" then
ServiceRequest = ServiceRequest + serviceFlex &chr(13) &chr(10)
end if
if not serviceRaking = "" then
ServiceRequest = ServiceRequest + serviceRaking &chr(13) &chr(10)
end if
if not serviceASP = "" then
ServiceRequest = ServiceRequest + serviceASP &chr(13) &chr(10)
end if
if not servicePHP = "" then
ServiceRequest = ServiceRequest + servicePHP &chr(13) &chr(10)
end if
if not serviceDev = "" then
ServiceRequest = ServiceRequest + serviceDev &chr(13) &chr(10)
end if

BodyText = BodyText & ServiceRequest &chr(13) &chr(10) & URL: " & siteURL & " URL" &chr(13) &chr(10) &chr(13) &chr(10)
BodyText = BodyText & "
Message: " & theMessage &chr(13) &chr(10)

myMail.TextBody=BodyText
myMail.Configuration.Fields.Item _
("
http://schemas.microsoft.com/cdo/configuration/sendusing")=2
'Name or IP of remote SMTP server
myMail.Configuration.Fields.Item _
("
http://schemas.microsoft.com/cdo/configuration/smtpserver") _
="
relay-hosting.secureserver.net"
'Server port
myMail.Configuration.Fields.Item _
("
http://schemas.microsoft.com/cdo/configuration/smtpserverport") _
=25
myMail.Configuration.Fields.Update
myMail.Send
set myMail=nothing


end if
%>
</head>
<body>
<table width="807" border="0" align="center" cellpadding="p" cellspacing="0">
<tr>
<td width="622" valign="top" bgcolor="#FFFFFF">
The form has been sent thank you. <br> <br></td>
</tr>
</table>

I hope this will give everyone a little better understanding of how to get your form mail working on go daddy. If your wondering how the email will look to you here is an example below

*********** Request For Estimate ***************
Name: Nicole Rutter
Address: 11124 my street
City: Omaha
State: Nebraska
Zip Code: 68154
Phone Number: 402-222-2222
Alternate Phone Number: 402-111-1111
Best Time to Call: Morning
Email Address: nicole@cfwebtools.com

Services Requested:
Flex

Website URL: nicole.cfwebtools.com

Message: Reqesting some information for a flex project

Happy coding!

Related Blog Entries

Comments
Nicole - You are a blessing to my little web world! Thanks for your selfless help! I tried your code, edited it a bit to my needs, and it works great!!

Thanks again! I truly appreciate it =)
# Posted By sime | 2/1/08 12:13 PM
Hi Nicole,

I'm not sure if you are a VB programmer (neither am I) but I'm trying to modify a code segment to relay mail thru my go-daddy email account rather that using gmail. I've modified the code below and tried port 80 and 3535 but it stops at the .send cmd. Any help would be appreciated:

My Code
iConf.Load -1 ' CDO Source Defaults
Set Flds = iConf.Fields


With Flds
.Item("http://schemas.microsoft.com/cdo/configuration/smt...") = True
.Item("http://schemas.microsoft.com/cdo/configuration/smt...") = 1

'.Item("http://schemas.microsoft.com/cdo/configuration/sen...") = "mygmail@gmail.com"
'.Item("http://schemas.microsoft.com/cdo/configuration/sen...") = "mypassword"
'.Item("http://schemas.microsoft.com/cdo/configuration/smt...") = "smtp.gmail.com"
'.Item("http://schemas.microsoft.com/cdo/configuration/sen...") = 2
'.Item("http://schemas.microsoft.com/cdo/configuration/smt...port" target="_blank">http://schemas.microsoft.com/cdo/configuration/smt...") = 465

.Item("http://schemas.microsoft.com/cdo/configuration/sen...") = "myuser@mygodaddy.com"
.Item("http://schemas.microsoft.com/cdo/configuration/sen...") = "mypassword"
.Item("http://schemas.microsoft.com/cdo/configuration/smt...") = "smtpout.secureserver.net"
'.Item("http://schemas.microsoft.com/cdo/configuration/smt...") = "relay-hosting.secureserver.net"
'.Item("http://schemas.microsoft.com/cdo/configuration/sen...") = 2
'.Item("http://schemas.microsoft.com/cdo/configuration/smt...port" target="_blank">http://schemas.microsoft.com/cdo/configuration/smt...") = 3535
.Item("http://schemas.microsoft.com/cdo/configuration/smt...port" target="_blank">http://schemas.microsoft.com/cdo/configuration/smt...") = 80
.Update
End With


My code stops on the send command

Set iMsg = CreateObject("CDO.Message")
With iMsg
Set .Configuration = iConf
.To = Email
.CC = ""
.BCC = ""
.From = """blah blah""<myuser@mygodaddy.com>"
.Subject = subj
.AddAttachment Attm
.TextBody = Msg
.Send
End With
Set iMsg = Nothing
# Posted By David Wright | 2/28/08 10:58 PM
I have the following code and it is working with most of the servers but i cannot get it work on ixwebhosting and i have received the following problem from the:

your messages have been discarded by our mail servers as non compatible with RFC. The messages have blank CC field (so, CC field presents, but it's blank).

and here is the code:

<%
form_from = "info@realitytravelguide.com"
form_to = "info@realitytravelguide.com"
form_cc = Request.Form("mail_cc")
form_bcc = Request.Form("mail_bcc")
form_subject = "Reality Form Submission"
form_importance = 1

FOR x = 1 TO Request.Form.Count
IF Request.Form.Key(x) = "mail_from" OR Request.Form.Key(x) = "mail_to" OR Request.Form.Key(x) = "mail_cc" OR Request.Form.Key(x) = "mail_bcc" OR Request.Form.Key(x) = "mail_subject" OR Request.Form.Key(x) = "mail_importance" OR Request.Form.Key(x) = "mail_redirect" OR Request.Form.Key(x) = "mail_send" OR Request.Form.Key(x) = "Submit" THEN
form_variables = form_variables
ELSE
form_variables = form_variables & Request.Form.Key(x) & ": " & vbcrlf & Request.Form.Item(x) & vbcrlf & vbcrlf
END IF
NEXT

DIM body_text
body_text = vbcrlf & "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" & vbcrlf
body_text = body_text & form_subject & vbcrlf
body_text = body_text & "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" & vbcrlf & vbcrlf
body_text = body_text & form_variables
body_text = body_text & "Sent from: " & vbcrlf & Request.ServerVariables("HTTP_REFERER") & vbcrlf & vbcrlf
body_text = body_text & "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" & vbcrlf


<!--SET objMail = Server.CreateObject("CDONTS.NewMail")-->

SET objMail = CreateObject("CDO.Message")

<!--objMail.BodyFormat = 1-->
<!--objMail.MailFormat = 1-->

objMail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sen...")=2

objMail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smt...") _
="127.0.0.1"

objMail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smt...port" target="_blank">http://schemas.microsoft.com/cdo/configuration/smt...") _
=25
objMail.Configuration.Fields.Update


objMail.From = form_from
objMail.To = form_to
objMail.CC = form_cc
objMail.BCC = form_bcc
objMail.Subject = form_subject
<!--objMail.Importance = form_importance-->
objMail.TextBody = body_text
objMail.Send
SET objMail = NOTHING

Response.Write("")
%>

Can you please helm me where i am making it wrong?
# Posted By beyaz | 3/24/08 6:11 AM
Just curious, but did you try this with some test e-mails other than your own as the sender. For example, I came up with very similar code but it blows for anyone using AOL.COM as the from e-mail. So I had to send it from myself to myself and just put the e-mail into the message.

In other words, you might be missing e-mail and not even know it because your AOL user got an error.
# Posted By Matt Carpenter | 3/31/08 8:05 PM
I'm having trouble implementing your code on my godaddy site.

I built my site using M.S. web developer express 2008 using aspx pages and one of those pages is a reservation form which I need emailed to me.

As I couldn't get the code working within the aspx pages I created two pages exactly as you presented them above, only substituting my email address for:
"YOUR EMAIL ADDRESS" in the the form
and
myMail.To in the start_thanksN.asp


It seems no matter what I do, every time I click on the submit button I get the following error:

500 - Internal server error.
There is a problem with the resource you are looking for, and it cannot be displayed.

I know this is a long shot, but do you have any idea what resource is missing?
# Posted By Steve | 5/31/08 3:12 PM
As a follow up to my above post the name of the generic form is form.html, but I'd really like to get the proper reservation form working.

Thnaks for your help
# Posted By Steve | 5/31/08 4:44 PM
Can you tell me a little more about your set up. Is this by chance a DNN site? This sounds like a set up problem to me. Are you running an SSL on this site? You can send over your code if you want to and I can test it. I know the above code is working I just tested it to be sure.
# Posted By Nicole Rutter | 6/2/08 7:51 AM
Thanks for the code! One little thing I noticed (that gave me a hard time) is that the "from" email address needs to be from a domain apparently hosted with godaddy. When I first tried it with Nicole's "test@yahoo.com", it worked fine. As soon as I changed it to a different email address (a hotmail account), it errored. I then tried my client's email address (hosted on godaddy) and viola... worked again.
# Posted By marty | 6/4/08 9:51 AM
Hello, I've got the above examples working, except for one thing -- I'm working on a newsletter mailer that utilizes the "BCC" field, so that emails are not leaked to other users, and it seems that my BCCs never get anything delivered to them.

Any ideas?
# Posted By Jon | 7/8/08 11:16 AM
How are you adding it?? Can you post your code or email it to me and I can take a look. Are you currently using go daddy hosting?

Set myMail=CreateObject("CDO.Message")
myMail.Subject="Testing CDO form mail by Nicole Rutter"
myMail.From=theEmail
myMail.To="nicole@cfwebtools.com"
myMail.Bcc="nicole@cfwebtools.com,nikki32@gmail.com"
# Posted By Nicole Rutter | 7/8/08 2:38 PM
marty-

I have tested the code using a gmail account that goes through just fine. I haven't tested on hotmail. Has anyone else experienced this problem using a hotmail account??
# Posted By Nicole Rutter | 7/8/08 2:39 PM
Oh, aha, I see you're using a comma to separate the bccs, where I'd been using the semi-colon, which is what worked on my last host...

Lo and behold, I think that was the problem!
# Posted By Jon | 7/9/08 8:27 AM
Oh crud, but now, because there's an HTML link in the message(?) I get this message from the GoDaddy server:

#(-2147220975) The message could not be sent to the SMTP server. The transport error code was 0x800ccc6f. The server response was 554 The message was rejected because it contains prohibited virus or spam content

Oh GoDaddy, how I hate thee, let me count the ways...
# Posted By Jon | 7/9/08 8:32 AM
Well double crud, looks like some old page on this site must have fallen to a sql injection attack... the link that offended GoDaddys mail server is listed in this page, describing the attack details:

http://www.bloombit.com/Articles/2008/05/ASCII-Enc...

Looks like I've got a new problem to fix now!
# Posted By Jon | 7/9/08 9:16 AM
I need help! I found your code and have been trying to get it to work on a site I've designed for a friend. I'll admit I'm not good at coding. I know the VERY basics. I've had basic forms on other sites that worked fine with GoDaddy until recently.

I would like to have two different forms on the site, but I can't get any of them to work.

Would you be willing to look at the site, try out the form, and look at the code? Maybe you'll see what I'm doing wrong!

http://www.infinitymassagecenter.com/contact.html
# Posted By denille | 7/23/08 1:18 PM
I moved my website to godaddy hosting and had a lot of problem trying to configure the imsg, plus their staff are useless...so after browsing around, I found ur coding, and all I did was had to change the host to relay-hosting.secureserver.net and everything was fixed ...
LMAO...so simple...

THANK YOU!!!!!!!
# Posted By Michelle | 8/8/08 2:00 PM
Denille
I'll have a look at your forms...
email me....my email is
apricot
_
Michelle
@
hotmail

I put it like that to protect my email :)
# Posted By Michelle | 8/8/08 2:03 PM
Michelle-

Great glad I could help! I believe Denille's code is now working. We exchanged emails back and forth.

-Nicole
# Posted By Nicole Rutter | 8/8/08 2:13 PM
you are a blessing!You should run for President!
# Posted By Amy | 10/8/08 12:17 PM
Thank you very much Michelle.

U saved my day

:)
# Posted By karlos | 10/9/08 8:18 AM
I spent a day trying the examples goDaddy had on their site to no avail. You saved the day! Thank you Nicole!!!
# Posted By Rob Nordin | 11/5/08 3:00 PM
glad I could help =)
# Posted By Nicole Rutter | 11/5/08 3:13 PM
Thanks so much. If it weren't for you, I'd still be screaming at a server that really didn't care if my formmail sent or not.

You're the best!

Cheers,
Michael
# Posted By Michael | 11/16/08 12:20 PM
Nicole--

I googled for other people with godaddy mail issues and came across your email. Looked at your code and compared it with my own asp script only to find that it's perfectly similiar to yours.

Have you ever found that Godaddy's service can be very intermittent and only work when it wants to?

I'm getting frustrated. From one hour to the next, it will work and then abruptly just stop working.

All GoDaddy can say to me is "Your code is a third party script for which we do not provide support for" and I mean, seriously, it works.

Any thoughts?
# Posted By Dan | 12/4/08 12:50 PM
Hi , thanks for the information. I'm having difficulty with the the return page as it is returning a compilation error.:

Microsoft VBScript compilation error '800a0400'

Expected statement

/formreply.asp, line 91

BodyText = BodyText & ServiceRequest &chr(13) &chr(10) & URL: " & siteURL & " URL" &chr(13) &chr(10) &chr(13) &chr(10)
--------------------------------------------------------------^
I have a number of sites using forms in subsidiary directories on an unlimited hosting plan with godaddy and since the transition from easycgi where they were on individual hosting plans I have been struggling to get these working.
Many thanks,
Dave Reed
# Posted By Dave | 1/3/09 6:04 AM
Dave, add a qoutes before the URL so it should be like this...
BodyText = BodyText & ServiceRequest &chr(13) &chr(10) & "URL: " & siteURL & " URL" &chr(13) &chr(10) &chr(13) &chr(10)
# Posted By Mike | 1/5/09 2:08 PM
I put up the ASP code as mentioned in your blog but emails don't hit my yahoo account at all. My Godaddy hosting is on IIS 6.0. Is that an issue.
# Posted By Vibhu Bansal | 1/17/09 9:58 AM
thank u, thank u, thank u
I would like to build a shrine for u

this was giving me a headache for so long, not because I lacked any necessary programming skills, but I just couldn't get the proper info from godaddy regarding the necessary parameters I needed to make the code run properly

again, thank u
# Posted By meez | 3/6/09 9:13 AM
Help me PLEASE. I need help in getting me godaady contact form to work.

THIS IS WHAT I'M GETTING WHEN I HIT "SEND":

virgoartdistrict.com-Form submission from virgoartdistrict.com?
From: formmailer@secureserver.net
Sent: Sat 3/14/09 1:04 PM
To: orangeart1@hotmail.com

-----------------------------------------------------------------This e-mail was generated from a form submission on your website: virgoartdistrict.com at 3/14/2009 10:04:04 AM
# Posted By Clyde | 3/14/09 2:37 PM
Hi Nicole

Thanks so much for this info it save me hours of frustration. You are the only one out of 70 blogs that helped with this.

Your form works perfectly and im able to adapt for our site.

Michael
# Posted By Michael | 4/6/09 1:42 PM
Hi Nicole (feedback form Genius),
A while back I implemented your form example to our website and since then I have redesigned the website and I am at the feedback form again ( i will think positive about learning how to do this better). Everything works fine except when I hit submit it displays:

CDO.Message.1 error '8004020d'

At least one of the From or Sender fields is required, and neither was found.

/feedback_form.asp, line 105

//this is what I have in the .asp file:

myMail.Configuration.Fields.Update (this is 105)
myMail.Send
set myMail=nothing
# Posted By Amy | 4/6/09 7:04 PM
Sooooo, how many of you are laughing at my last comment :)

You are awesome!

Thank You it works well.....

:)
# Posted By Amy | 4/6/09 8:39 PM
Michael-

Glad I could help. I know its frustrating!

Nikki
# Posted By Nicole Rutter | 4/14/09 9:37 AM
Your code was awesome, worked on the first try! Thanks!!!!
# Posted By Florin | 4/14/09 6:50 PM
Hello,
I like your security image feature for the form, I am having problems with forms going through godaddy, looks like robots send random junk all the time, could you point me to a good source for the security image feature? I appreciate it. I tried to setup using CAPTCHA but doesnt worl right, if it fails, it sends email with data anyway... Thanks
# Posted By Mia | 4/14/09 6:54 PM
hey nicole, thank you so much for the help. I'm with godaddy as well and it's been a trying time to figure out their forms and frustrating that it would only allow one email address...ugh.

Anyway, i copied your code and made some adjustments but I get an error when I try to post. the error is:

error '80040211'

/aspform/start_thanksN.asp, line 105

the line is: myMail.Send

any ideas?
# Posted By Steve | 4/28/09 9:13 AM
just an update. if i change the myMail.From=theEmail line to include an actual email address it goes through but doesn't actually work as it doesn't have the correct email to send to the 'user'.

like if i change the line to myMail.From="test@test.com" then it will send the email to test but not what the person actually put in.
# Posted By Steve | 4/28/09 10:07 AM
it would seem that I have to put a legit godaddy email account in the myMail.From variable. if I put what you have then it bombs. If I put a good email address from my site in there it goes through fine. However we have an autoresponder on the email that gets the forms, so it's sending the "thank you" to an account that doesn't need it....any ideas? Wonder if this is something godaddy has recently changed. i'd LOVE to get this working. I have a 65 field form that I need to get captcha working on and want to redo the whole thing and would LOVE to be able to use this instead of the gdform.asp junk.
# Posted By Steve | 4/28/09 12:37 PM
I recently used this form on godaddy and it was working fine. I also am having problems with myMail.Send now. They changed something. Desperately looking for an answer.

:)
# Posted By Amy Thompson | 5/29/09 8:56 AM
It appears that when sending out email from your GoDaddy hosted account that:

1) The FROM address must equal your domain name. (i.e. If my site's domain is xyz.com then I must send it from brian@xyz.com; NOT brian@abc.com).

2) The FROM, TO, CC, and BCC values must not share the same domain name. Using my example in #1 above, I cannot send that same email to myself (i.e the TO, CC, and BCC fields cannot be brian@xyz.com).

Hope that helps.
# Posted By Brian Mulhern | 6/10/09 11:13 AM
It's a good idea for the processing and evaluation of the page. I think many will be interested.
The site http://www.queentorrent.com you can download for free a lot of interesting movies.
# Posted By Katty Lee | 7/7/09 12:46 PM
Nicole, Like most everyone else that has posted on your blog, I've run into serious trouble with using forms and GoDaddy hosting. I've tried using your scripts for testing but I keep running into weird errors. I just took your form and processor script "as is" to use for testing. I put my email address for the "myMail.To" portion, etc. Had to add some quotes in one spot to get rid of an error code....but now when I test the form, by filling in all of the fields, the error I get is HTTP 500 Internal Server Error....HOWEVER, if I fill in any of the fields EXCEPT the Name field, it returns with "The form has been sent thank you"....but I do not receive an email. What am I doing wrong???? Help Please!!!! Thank you so much for your work on this.
# Posted By Kelleyene | 7/21/09 12:08 PM
I am about to pull my hair out with GoDaddy’s forms, too….
As you probably know, GoDaddy has outgoing mail restrictions for sbcglobal.net, hotmail, etc. Those addresses can’t be put into a form. I get Error 800402e line 48 and 500 Internal Server Error.
When I talk to godaddy they say I have to have something like this:
// language -- C#
// import namespace
using System.Web.Mail;

private void SendEmail()
{
const string SERVER = "relay-hosting.secureserver.net";
MailMessage oMail = new System.Web.Mail.MailMessage();
oMail.From = "emailaddress@domainname";
oMail.To = "emailaddress@domainname";
oMail.Subject = "Test email subject";
oMail.BodyFormat = MailFormat.Html; // enumeration
oMail.Priority = MailPriority.High; // enumeration
oMail.Body = "Sent at: " + DateTime.Now;
SmtpMail.SmtpServer = SERVER;
SmtpMail.Send(oMail);
oMail = null; // free up resources

I am not a coder and am very confused. This seems like a completely different coding language than the ASP I am using. By any chance do you know how I can make the below form work? I would really appreciate your help. I have this form on several websites, but this one is http://www.waterfowloutfittersunlimited.com/guest....

Thanks,

Leslie


<%
If Not Request.Form("nospam") = "nospam" Then
Response.Redirect "http://www.waterfowloutfittersunlimited.com/error...."
End If
%>
<%
For Field = 1 to Request.Form.Count - 3
FieldName = Replace(Request.Form.Key(Field),"_"," ")
FieldValue = Request.Form.Item(Field)
Body = Body & FieldName & ": " & FieldValue & VbCrLf
Next
'Dimension variables
Dim objCDOSYSCon
'Create the e-mail server object
Set objCDOSYSMail = Server.CreateObject("CDO.Message")
Set objCDOSYSCon = Server.CreateObject ("CDO.Configuration")
'Set and update fields properties
With objCDOSYSCon
'Outgoing SMTP server
.Fields("http://schemas.microsoft.com/cdo/configuration/smt...")="relay-hosting.secureserver.net"

.Fields("http://schemas.microsoft.com/cdo/configuration/smt...port" target="_blank">http://schemas.microsoft.com/cdo/configuration/smt...") = 25
'CDO Port
.Fields("http://schemas.microsoft.com/cdo/configuration/sen...") = 2
'Timeout
.Fields("http://schemas.microsoft.com/cdo/configuration/smt...") = 60

.Fields.Update
End With
'Update the CDOSYS Configuration
Set objCDOSYSMail.Configuration = objCDOSYSCon
'Set and update email properties
With objCDOSYSMail
'0=Low, 1=Normal, 2=High
.Fields("urn:schemas:httpmail:importance").Value = 1
'Who the e-mail is from
.From = Request.Form("email")
'Who the e-mail is sent to
.To = "lesliel@flash.net"
'Who the e-mail is CC'd to
'.Cc = ""
'The subject of the e-mail
.Subject = Request.Form("email_subject")
'Set the e-mail body format (HTMLBody=HTML TextBody=Plain)
.TextBody = Body
.Fields.Update
'Send the e-mail
.Send
End With
'Close the server mail object
Set objCDOSYSMail = Nothing
Set objCDOSYSCon = Nothing
'Rederect after sending email
Response.Redirect Request.Form("redirect_to")
%>
# Posted By Leslie | 7/29/09 4:35 PM
Look guys, it's really simple and godaddy's tech support are too dumb to know what you are asking for when you call, so bless Nicole for starting this blog. BUT the reason you are not able to receive your asp forms by email is very simple! The port is changed from the standard 25 to 80. That's it. Simple as...
Other than that, if your form is still not working, make sure you set the relay server as "relay-hosting.secureserver.net".....
# Posted By Michelle | 7/30/09 12:40 AM
Bringing this up to date for .NET. for Godaddy users. The main issue for me was I could not use code behind to get information entered into the form when using their form email limitations, no thanks to Godaddy here, their scripting support is all but non-existant. Here is my C@ solution...

My Contact Us form HTML...
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ContactUs.aspx.cs" Inherits="CovertConsulting.ContactUs" %>
<%@ Register TagPrefix="CovertConsulting" TagName="Header" Src="_Header.ascx" %>
<%@ Register TagPrefix="CovertConsulting" TagName="Menu" Src="_Menu.ascx" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitiona...">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Covert Consulting Contact Us</title>
<meta name="keywords" content="consulting, programming, .NET, Silverlight, Microsoft programming, web development, computer programming,
computer consulting, PDA, PDA Development, Tampabay, Tampa Bay, Clearwater, St. Petersburg, PDA programming, Windows Mobile,
Windows Mobile development, Windows Mobile programming, software contracting, computer contracting, Kirk Covert, Molokan"/>
   <meta name="description" content="Computer consulting and programming services"/>
   <meta name="author" content="Kirk Covert"/>
   <meta name="robots" content="ALL"/>
   <link rel="stylesheet" type="text/css" href="CovertConsulting.css"/>
<style type="text/css">
.style1
{
width: 146px;
}
</style>
</head>
<body class="Body">
<form id="frmContactUs" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<table cellspacing="0" cellpadding="0" width="100%" border="0">
      <tr>
         <td colspan="2">
            <CovertConsulting:Header ID="Header" runat="server" />
         </td>
      </tr>
      <tr>
         <td valign="top" colspan="1" class="style1">
            <CovertConsulting:Menu id="Menu" runat="server" width="145" />

         </td>
         <td align="left" valign="top" width="*" style="width: 747px" >
            <table align="left" cellspacing="0" cellpadding="0" border="0" style="width: 100%; height: 71px" >
               <tr valign="top">
                  <td style="height: 15px">
                   <br/>
                     <img alt="" align="left" width="24" src="images/1x1.gif" />
                     <table cellspacing="0" cellpadding="0" width="100%" height="20">
                        <tr>
                           <td class="HomeHead">
                              <asp:Label id="WelcomeMsg" runat="server">Look Forward To Hearing From You !</asp:Label>
                           </td>
                        </tr>
                     </table>
                  </td>
               </tr>
            </table>
         </td>
      </tr>
   </table>
<div>
<asp:Label id="lblDunnMess" runat="server" style="z-index: 100; left: 199px; position: absolute; top: 280px">Use this form to contact us, report website problems, make website suggestions, or for other general communications.</asp:Label>
         <asp:Label id="Label1" runat="server" Font-Bold="True" style="z-index: 101; left: 210px; position: absolute; top: 336px">From:</asp:Label>
         <asp:TextBox id="txtFrom" runat="server" Width="192px" style="z-index: 102; left: 265px; position: absolute; top: 333px"></asp:TextBox>
         <asp:RequiredFieldValidator id="rfvFrom" runat="server" ErrorMessage="RequiredFieldValidator" ControlToValidate="txtFrom" style="z-index: 103; left: 468px; position: absolute; top: 336px" Width="130px">* Name is required</asp:RequiredFieldValidator>
         <asp:Label id="Label2" runat="server" Font-Bold="True" style="z-index: 104; left: 207px; position: absolute; top: 378px">Email:</asp:Label>
         <asp:TextBox id="txtEmail" runat="server" Width="192px" style="z-index: 105; left: 264px; position: absolute; top: 376px"></asp:TextBox>
         <asp:RequiredFieldValidator id="rfvEmail" runat="server" ErrorMessage="RequiredFieldValidator" ControlToValidate="txtEmail" style="z-index: 106; left: 472px; position: absolute; top: 380px" Width="201px">* Your email address is required</asp:RequiredFieldValidator>
         <asp:Label id="Label3" runat="server" Font-Bold="True" style="z-index: 107; left: 195px; position: absolute; top: 417px">Subject:</asp:Label>
         <asp:TextBox id="txtSubject" runat="server" Width="304px" style="z-index: 108; left: 263px; position: absolute; top: 416px"></asp:TextBox>
         <asp:RequiredFieldValidator id="rfrSubject" runat="server" ErrorMessage="RequiredFieldValidator" ControlToValidate="txtEmail" style="z-index: 109; left: 592px; position: absolute; top: 418px" Width="166px">* Subject is required</asp:RequiredFieldValidator>
         <asp:Label id="Label4" runat="server" Font-Bold="True" style="z-index: 110; left: 180px; position: absolute; top: 490px">Message:</asp:Label>
         <asp:TextBox id="txtMessage" runat="server" Width="456px" Height="200px" style="z-index: 111; left: 262px; position: absolute; top: 480px"></asp:TextBox>
         <asp:RequiredFieldValidator id="rfvMessage" runat="server" Width="72px" Height="48px" ErrorMessage="RequiredFieldValidator" ControlToValidate="txtMessage" style="z-index: 112; left: 177px; position: absolute; top: 530px">* Message is required</asp:RequiredFieldValidator>
 

<asp:ImageButton ID="SubmitButton" runat="server" ImageUrl="~/Images/submit.gif"
Style="z-index: 113; left: 330px; position: absolute; top: 699px; right: 657px;"
OnClick="SubmitButton_Click" Height="42px" Width="104px" />
<asp:ImageButton ID="ClearButton" runat="server" ImageUrl="~/Images/ClearForm.gif"
Style="z-index: 114; left: 575px; position: absolute; top: 702px" Height="36px" OnClick="ClearButton_Click" Width="99px" />
<asp:Label ID="Label5" runat="server" Style="z-index: 116; left: 761px; position: absolute;
top: 561px" Text="If you prefer to call dial Kirk at 727-643-8080" Width="141px"></asp:Label>
</div>
</form>
</body>
</html>

The only code behind for this page...
protected void SubmitButton_Click(object sender, ImageClickEventArgs e)
{
Response.Redirect("MailSent.aspx?txtFrom=" + txtFrom.Text.Trim() + "&txtEmail=" + txtEmail.Text.Trim() + "&txtSubject=" + txtSubject.Text.Trim() + "&txtMessage=" + txtMessage.Text.Trim());

}

protected void ClearButton_Click(object sender, ImageClickEventArgs e)
{
this.txtFrom.Text = "";
this.txtSubject.Text = "";
this.txtMessage.Text = "";
this.txtEmail.Text = "";
}

The receiving/processing page code behind...

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Mail;

namespace CovertConsulting
{
public partial class MailSent : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
try
{
string person = Request.QueryString["txtFrom"];
string emailfrom = Request.QueryString["txtEmail"];
string subject = Request.QueryString["txtSubject"];
string message = Request.QueryString["txtMessage"];

const string SERVER = "relay-hosting.secureserver.net";
MailMessage oMail = new System.Web.Mail.MailMessage();
oMail.From = emailfrom;
oMail.To = "kcovert1@verizon.net";
oMail.Subject = subject;
oMail.BodyFormat = MailFormat.Text; // enumeration
oMail.Priority = MailPriority.High; // enumeration
oMail.Body = "From: " + person + " " + message + " " + "Sent at: " + DateTime.Now;
SmtpMail.SmtpServer = SERVER;
SmtpMail.Send(oMail);
oMail = null; // free up resources

lblDunnMess.Text = "Email sent!, Thankyou!";
}
catch (Exception ex)
{
lblDunnMess.Text = "Email Send Failed: " + ex.Message;
}
}
}
}


The reason this works is becasue the Godaddy site does not do it's prevent when the information for the email is passed like this instead of getting the information using code behind on the same aspx page. Hard coding does work if done on the same page using code behind.
# Posted By Kirk | 8/21/09 9:06 AM
Hello,
I've been searching all over the net for a solution to using a ContactUs web form to use with my GoDaddy Webhost account. I tried multiple examples and all have failed. I'm especially interested in Kirk's post since he has worked on a .net version..now I'm wondering if this code still works..I had many failed attempts due to outdated code. Can anyone help.
# Posted By Shaolin | 9/30/09 11:40 AM



Blog provided and hosted by CF Webtools. Blog Sofware by Ray Camden.