GoDaddy script problems, Dave!
am 13.09.2007 17:02:01 von jp2code
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:
>
> <%@ 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@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
>
> %>
>
Re: GoDaddy script problems, Dave!
am 24.09.2007 03:26:55 von McKirahan
"jp2code" wrote in message
news:uhLKLch9HHA.748@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:
> >
> > <%@ 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@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:
<%@ 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@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
Re: GoDaddy script problems, Dave!
am 24.09.2007 17:47:05 von jp2code
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:
>
> <%@ 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@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
>
>