I have a friend who currently has a website hosted through Go Daddy who was having form mail problems. He has had a Go Daddy account for a while now and all had been well until he decided to change his domain name. Turns out his old site was actually on an older Go Daddy server that supported CDONTS. Changing his domain name and transferring his information to his new domain placed it on a newer Go Daddy server.
ASP CDONTS has been used for quit some time and he did not expect a problem when switching domains. It was pretty evident that once he moved his site that his form mail was no longer working. The code would not throw an error it would simply not send his form mail. After spending a few hours on the phone with go daddy support the only solution they were able to provide was to use there built in gdform.asp. After careful review of the code I decided there had to be a better way. If your hosting on a Go Daddy server now I highly recommend you use CDO.Message, and if you have existing CDONTS code, that you convert it to CDO.Message now, rather than waiting until you absolutely have to.
I searched several forums only to find out that there really wasn't a good solution out there for this issue. By this time my friend was getting pretty frustrated with Go Daddy and the support that they were providing. After trying a few different ways of sending ASP form mail I finally decided to use CDO.Message. At last it worked! I hope that this blog will save you hours and hours of testing and phone calls. I think my friend owes me one ;). After figuring out the solution to the problem I did attempt to contact Go Daddy for the old domains server IIS and SMTP configuration VS the new configuration but he was unable to provide that information =) hmmm go figure.
The only thing I can think of is the old server was still on IIS 5.0...CDONTS components where standard with IIS 5.0. Understanding that microsoft removed the component from IIS 5.1 on Windows XP I would have to assume there is not a copy of the cdonts.dll on the new IIS server. Why Go Daddy decided not to support CDONTs any more who knows?
Still confused? Check out my latest post on this issue with a working example. http://nicole.cfwebtools.com/index.cfm/2008/2/1/Go-Daddy-ASP-CDONTs-form-mail-issue-CONTINUED
("http://schemas.microsoft.com/cdo/configuration/sen...") =your email address
Mail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sen...") =your email password
Is there a way to add HTML tags to email sent?
Like a 'Set email type 1=text 0=html
This is my CDONTS code I'm trying to convert:
'Form inputs to variables
sName = Request.Form("Name")
Email = Request.Form("Email")
Comments = Request.Form("Comments")
'Create mailbody variable
mailbody = mailbody & "Name: " & sName & "<br />"
mailbody = mailbody & "Email: " & Email & "<br />"
mailbody = mailbody & "Comments: " & Comments & "<br />"
'send email copy of meeting request
DIM objMail
Set objMail = Server.CreateObject("CDONTS.NewMail")
objMail.From = Email
objMail.Subject = "From Meeting Form"
objMail.To = "xx@xx.com"
'Set email type 1=text 0=html
objMail.BodyFormat=0
objMail.MailFormat=0
objMail.Body = mailbody
objMail.Send
Set objMail = nothing
Thanks for your post!
Michelle
<!-- EMAIL SUBMISSION -->
<%@ Language="VBSCRIPT" %>
<%
If Request.ServerVariables("REQUEST_METHOD") = "POST" THEN
'*
'* SEND MAIL
'*
fullname = Request.Form("fullname")
emailaddress = Request.Form("emailaddress")
phone = Request.Form("phone")
info = Request.Form("info")
dim MessageBodyHTML
MessageBodyHTML = "<SPAN style='font-family:arial; font-size:10pt;'><strong>FULL NAME:</strong> " & fullname & Chr(10) & _
"<br><strong>EMAIL ADDRESS:</strong> " & emailaddress & Chr(10) & _
"<br><strong>STREET ADDRESS:</strong> " & phone & Chr(10) & _
"<br><strong>STREET ADDRESS (cont):</strong> " & info & Chr(10) & _
"<br><br><strong>Date:</strong> " & date()
dim MessageBody
MessageBody = "Name: " & Request.Form("fullname") & vbCrLf _
& "Email: " & Request.Form("emailaddress") & vbCrLf _
& "Phone: " & Request.Form("phone") & vbCrLf & vbCrLf _
& Request.Form("info")
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'''' this is the CDO object (newer verwsion of CDONTS)
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
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("emailaddress")
objCDO.Subject = "Northport Web Contact Form"
objCDO.To = "tymm@comcast.net"
objCDO.TextBody = MessageBody
objCDO.HTMLBody = MessageBodyHTML
objCDO.Send
'You must always do this with CDONTS.
set objCDO = nothing
set objCFG = nothing
End If
%>
<!-- END EMAIL SUBMISSION -->
Here's the deal...I have successfully used their GDForm on my site...and I am using it to collect names/emails for a newsletter sign-up. The trouble began when I was trying to add a Contact Form as well...this is not working.
Your 'solution' , at this point, makes no sense to me. I was wondering if you could a) explain how to implement that code/use a form with it or b) add another instance of gdform?
I know that is complicated?? Please email me to discuss...I am struggling here!!
Thanks if you can help
http://nicole.cfwebtools.com/index.cfm/2008/2/1/Go...
<%
sendUrl="http://schemas.microsoft.com/cdo/configuration/sen..."
smtpUrl="http://schemas.microsoft.com/cdo/configuration/smt..."
' Set the mail server configuration must be set exactly else it will not work.
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="webmaster@youdomain.net"
objMail.To="test@test.com"
objMail.Subject="subject"
objMail.TextBody="body"
objMail.Send
%>
Use this site http://www.queentorrent.com do not regret it.
> ????????
I used your script but its not working for me Its give the following error:
Server Error
500 - Internal server error.
There is a problem with the resource you are looking for, and it cannot be displayed.
Can you help?
TIA
pankaj
<identity impersonate="true" />