GoDaddy script problems, Dave!

Some time ago, one of the guys on here named Dave gave me a sample script
for sending emails using Classic ASP on a website hosted by GoDaddy.

GoDaddy includes their gdform.asp for collecting information on a form and
submitting it, but the format of the message that is sent to me can not be
modified because GoDaddy has their own script that acts upon the gdform.asp
script. Rats!

Anyway, I've got a page that uses Dave's example below.

The page loads, I can fill in information, click my submit button, and
everything seems to work.

Except - the email message never arrives!

Is there a way to do some error checking on the code below? Are the more
options I could include to ensure my message arrives?

Thanks in advance!

Dave's code follows:

--- On 8/3/2007 at 3:19 PM in response to the thread titled "non-ASP speaker
with gdform.asp problems", "Dave" wrote:
> You are NOT required to use GDFORM on GoDaddy. You just have to know
> something about ASP programming and how to use CDONTS.
>
> Here is the code I use to process a contact form and send me an email:
>
> <% [at] Language="VBSCRIPT" %>
> <%
>
> If Request.ServerVariables("REQUEST_METHOD") = "POST" Then
>
> Dim objMail
> Set objMail = Server.CreateObject("CDONTS.NewMail")
>
> objMail.From = Request.Form("email")
> objMail.Subject = "Contact Form"
> objMail.To = "me [at] mymail.here"
> objMail.Body = "Name: " & Request.Form("name") & vbcrlf & "Email: " &
> Request.Form("email") & vbcrlf & vbcrlf & Request.Form("comments")
> objMail.Send
>
> set objMail = nothing
>
> End If
>
> %>
>
jp2code [ Do, 13 September 2007 17:02 ] [ ID #1819554 ]

Re: GoDaddy script problems, Dave!

"jp2code" <poojo.com/mail> wrote in message
news:uhLKLch9HHA.748 [at] TK2MSFTNGP04.phx.gbl...
> Some time ago, one of the guys on here named Dave gave me a sample script
> for sending emails using Classic ASP on a website hosted by GoDaddy.
>
> GoDaddy includes their gdform.asp for collecting information on a form and
> submitting it, but the format of the message that is sent to me can not be
> modified because GoDaddy has their own script that acts upon the
gdform.asp
> script. Rats!
>
> Anyway, I've got a page that uses Dave's example below.
>
> The page loads, I can fill in information, click my submit button, and
> everything seems to work.
>
> Except - the email message never arrives!
>
> Is there a way to do some error checking on the code below? Are the more
> options I could include to ensure my message arrives?
>
> Thanks in advance!
>
> Dave's code follows:
>
> --- On 8/3/2007 at 3:19 PM in response to the thread titled "non-ASP
speaker
> with gdform.asp problems", "Dave" wrote:
> > You are NOT required to use GDFORM on GoDaddy. You just have to know
> > something about ASP programming and how to use CDONTS.
> >
> > Here is the code I use to process a contact form and send me an email:
> >
> > <% [at] Language="VBSCRIPT" %>
> > <%
> >
> > If Request.ServerVariables("REQUEST_METHOD") = "POST" Then
> >
> > Dim objMail
> > Set objMail = Server.CreateObject("CDONTS.NewMail")
> >
> > objMail.From = Request.Form("email")
> > objMail.Subject = "Contact Form"
> > objMail.To = "me [at] mymail.here"
> > objMail.Body = "Name: " & Request.Form("name") & vbcrlf & "Email: " &
> > Request.Form("email") & vbcrlf & vbcrlf & Request.Form("comments")
> > objMail.Send
> >
> > set objMail = nothing
> >
> > End If
> >
> > %>

Try this with your GoDaddy page:

<% [at] Language="VBSCRIPT" %>
<% If Request.ServerVariables("REQUEST_METHOD") = "POST" Then
'*
'* Send Email
'*
Dim strBOD
strBOD = "Name: " & Request.Form("name") & vbCrLf _
& "Email: " & Request.Form("email") & vbCrLf & vbCrLf _
& Request.Form("comments")
Dim objCFG
Set objCFG = Server.CreateObject("CDO.Configuration")
objCFG.Fields.Item(aCDO & "sendusing") = 2
objCFG.Fields.Item(aCDO & "smtpserver") =
"relay-hosting.secureserver.net"
objCFG.Fields.Item(aCDO & "smtpserverport") = 25
objCFG.Fields.Update
Dim objCDO
Set objCDO = Server.CreateObject("CDO.Message")
objCDO.Configuration = objCFG
objCDO.From = Request.Form("email")
objCDO.To = "me [at] mymail.here"
objCDO.Subject = "Contact Form"
objCDO.TextBody = strBOD
objCDO.Send
Set objCDO = Nothing
Set objCFG = Nothing
End If
%>



GoDaddy Help Center:

How Do I Use CDOSYS to Send Email?
http://help.godaddy.com/article.php?article_id=1073
McKirahan [ Mo, 24 September 2007 03:26 ] [ ID #1827981 ]

Re: GoDaddy script problems, Dave!

Thanks McKirahan.

I had noticed after some time that I was using the outdated CDONTS instead
of the CDOSYS like you included in your response.

My form(s) work now!

"McKirahan" wrote:
> Try this with your GoDaddy page:
>
> <% [at] Language="VBSCRIPT" %>
> <% If Request.ServerVariables("REQUEST_METHOD") = "POST" Then
> '*
> '* Send Email
> '*
> Dim strBOD
> strBOD = "Name: " & Request.Form("name") & vbCrLf _
> & "Email: " & Request.Form("email") & vbCrLf & vbCrLf _
> & Request.Form("comments")
> Dim objCFG
> Set objCFG = Server.CreateObject("CDO.Configuration")
> objCFG.Fields.Item(aCDO & "sendusing") = 2
> objCFG.Fields.Item(aCDO & "smtpserver") =
> "relay-hosting.secureserver.net"
> objCFG.Fields.Item(aCDO & "smtpserverport") = 25
> objCFG.Fields.Update
> Dim objCDO
> Set objCDO = Server.CreateObject("CDO.Message")
> objCDO.Configuration = objCFG
> objCDO.From = Request.Form("email")
> objCDO.To = "me [at] mymail.here"
> objCDO.Subject = "Contact Form"
> objCDO.TextBody = strBOD
> objCDO.Send
> Set objCDO = Nothing
> Set objCFG = Nothing
> End If
> %>
>
>
>
> GoDaddy Help Center:
>
> How Do I Use CDOSYS to Send Email?
> http://help.godaddy.com/article.php?article_id=1073
>
>
jp2code [ Mo, 24 September 2007 17:47 ] [ ID #1827985 ]
Webserver » microsoft.public.inetserver.asp.general » GoDaddy script problems, Dave!

Vorheriges Thema: Operation is not allowed when the object is closed with Insert stored procedure
Nächstes Thema: Help with the use of an 'Object' - please