PDA

View Full Version : mail form problem


LuckyOneStars13
09-03-2004, 07:47 AM
ok im having a problem with my mail form scripting, rather the form functions fine it just doesn't send the email to my inbox. Can anybody tell me what im doing wrong or suggest a tutorial or build the scritp for me please? the email form is on the http://www.forddesigngroup.com website in the bottom left corner. here is the asp script i used.......


<% @language="VBSCRIPT" %>
<%

Dim myMail, myBody

myBody = "Name: "& request.form("name") & vbcrlf
myBody = myBody & "company: "& request.form("company") & vbcrlf
myBody = myBody & "address: "& request.form("address") & vbcrlf
myBody = myBody & "email: "& request.form("email") & vbcrlf
myBody = myBody & "phone: "& request.form("phone") & vbcrlf
myBody = myBody & "Message: "& vbcrlf & request.form("message")

Set myMail = CreateObject("CDONTS.NewMail")

myMail.BodyFormat=1
myMail.MailFormat=1
myMail.From=request.form("email")
myMail.To="jada@forddesigngroup.com"
myMail.Subject="Ford Design Group Website Mail"
myMail.Body=myBody
myMail.Send

set myMail=nothing

%>

<html>
<title>mail</title>
<head>
<!--THIS BIT SENDS VISITOR BACK TO basic_mail.htm AFTER 3 SECONDS-->
<meta http-equiv="refresh" content="3;URL=home.htm">
</head>

<!--THIS BIT SAYS THANKS AND HAS A MANUAL LINK BACK TO basic_mail.htm-->
<body bgcolor="#3975B0" text="#000066" link="#0000CC" vlink="#0000CC" alink="#0000CC">
<div align="center">
<p><font face="Verdana" size="2" color="#000080"> <font face="Arial, Helvetica, sans-serif" size="4"><b>THANK YOU FOR CHOOSING <font face="Verdana" size="4" color="#FFFFFF">FORD DESIGN GROUP</font> ....</b></font></font></p>
<p><b><font face="Arial, Helvetica, sans-serif" size="4" color="#000080">To Return To Homepage</font></b></p>
<p><b><font face="Arial, Helvetica, sans-serif" size="4" color="#000080"><a href="home.htm">Click Here</a> </font></b> </p>
</div>
</body>
</html>

Cota
09-06-2004, 02:48 AM
ok, first things first. Make sure you're server supports CDONTS, I know it sounds stupid, but you'd be surprised. Also, for safty reasons, change this line

Dim myMail, myBody


to


Dim myMail, myBody, i


Sometimes ASP never creates the last variable in the DIM statement. Which is why you use 'i' as the dummy variable.

Second, ASP doesnt really support VB constants, therefore, you have to define them. So this should be right after your dim statement

vbcrlf = Chr(13) & Chr(10)


See if that changes anything.