K
Kingdom
Having a problem with a jmail email script and cannot seem to solve this
error any sugestions welcome.
Error shows in browser as
Microsoft VBScript runtime error '800a01f4'
Variable is undefined: 'JMail'
/SendEMail2.asp, line 38
========================================================
sendemail2 script
========================================================
<%
Option Explicit
Response.Expires = -10000
%>
<%
Dim mComponentLoop
Dim mComponentCount
mComponentCount = Request.Form("ComponentCount")
If Request.Form("name") <> "" Then
Dim EMail, Name, Tel, Recipient, Subject
EMail = Request.Form("EMail")
Name = Request.Form("Name")
Tel = Request.Form("Tel")
Recipient = Request.Form("Recipient")
Subject = "Potential customer interest"
'start email section
'**************** COMMENT THIS OUT TO SEND JMAIL ******
'Response.Write "This is just the confirmation page.<br /><br />"
'Response.Write "Name:" & Name & "<br />"
'Response.Write "EMail:" & EMail & "<br />"
'Response.Write "Tel:" & Tel & "<br />"
'Response.Write "Recipient:" & Recipient & "<br />"
'Response.Write "Subject:" & Subject & "<br />"
'Response.Write "BodyText:" & Request.Form("bodytext")
'Response.End
'*****************************************************
Set JMail = Server.CreateObject ("JMail.SMTPMail")
JMail.ServerAddress = "actual address removed"
JMail.Sender = Name
JMail.ReplyTo = Email
JMail.Subject = Subject
JMail.AddRecipient Recipient
JMail.Body = Name & Email & Tel & vbCrLf & BodyText
JMail.Priority = 3
JMail.AddHeader "Originating-IP", Request.ServerVariables("REMOTE_ADDR")
JMail.Execute
Set jMail = Nothing
Response.Redirect("formthanks.html")
'Else
'do nothing, just display blank form
'End IF
ODBCConnection.Close
Set ODBCConnection=Nothing
Else
Dim mEMailBody
mEMailBody = mEMailBody & "<table border='0' cellspacing='1'
cellpadding='1' width='400'>"
mEMailBody = mEMailBody & "<tr><td><b>Component</b></td><td align='right'>
<b>£</b></td></tr>"
For mComponentLoop = 1 to mComponentCount
mEMailBody = mEMailBody & "<tr>"
mEMailBody = mEMailBody & "<td>" & Request.Form("Component" &
mComponentLoop) & "</td>"
mEMailBody = mEMailBody & "<td align='right'>" & Request.Form
("ComponentPrice" & mComponentLoop) & "</td>"
mEMailBody = mEMailBody & "</tr>"
Next
mEMailBody = mEMailBody & "<tr><td align='right'><b>Total:</b></td><td>£" &
Request.Form("ComponentPriceTotal") & "</td></tr>"
mEMailBody = mEMailBody & "</table>"
Response.Write mEMailBody
Response.Write "<form method='post' action='SendEMail2.asp'>"
Response.Write "Name:<input type='text' name='Name' value='' /><br />"
Response.Write "EMail Address:<input type='text' name='EMail' value='' /
<br/>"
Response.Write "Tel No:<input type='text' name='Tel' value='' /><br />"
Response.Write "<input type=""hidden"" name=""Recipient""
value=""(e-mail address removed)"" /><br />"
Response.Write "<input type=""hidden"" name=""BodyText"" value=""" &
mEMailBody & """ />"
Response.Write "<input type=""submit"" value="" Send EMail "" /><br />"
Response.Write "</form>"
End If
%>
error any sugestions welcome.
Error shows in browser as
Microsoft VBScript runtime error '800a01f4'
Variable is undefined: 'JMail'
/SendEMail2.asp, line 38
========================================================
sendemail2 script
========================================================
<%
Option Explicit
Response.Expires = -10000
%>
<%
Dim mComponentLoop
Dim mComponentCount
mComponentCount = Request.Form("ComponentCount")
If Request.Form("name") <> "" Then
Dim EMail, Name, Tel, Recipient, Subject
EMail = Request.Form("EMail")
Name = Request.Form("Name")
Tel = Request.Form("Tel")
Recipient = Request.Form("Recipient")
Subject = "Potential customer interest"
'start email section
'**************** COMMENT THIS OUT TO SEND JMAIL ******
'Response.Write "This is just the confirmation page.<br /><br />"
'Response.Write "Name:" & Name & "<br />"
'Response.Write "EMail:" & EMail & "<br />"
'Response.Write "Tel:" & Tel & "<br />"
'Response.Write "Recipient:" & Recipient & "<br />"
'Response.Write "Subject:" & Subject & "<br />"
'Response.Write "BodyText:" & Request.Form("bodytext")
'Response.End
'*****************************************************
Set JMail = Server.CreateObject ("JMail.SMTPMail")
JMail.ServerAddress = "actual address removed"
JMail.Sender = Name
JMail.ReplyTo = Email
JMail.Subject = Subject
JMail.AddRecipient Recipient
JMail.Body = Name & Email & Tel & vbCrLf & BodyText
JMail.Priority = 3
JMail.AddHeader "Originating-IP", Request.ServerVariables("REMOTE_ADDR")
JMail.Execute
Set jMail = Nothing
Response.Redirect("formthanks.html")
'Else
'do nothing, just display blank form
'End IF
ODBCConnection.Close
Set ODBCConnection=Nothing
Else
Dim mEMailBody
mEMailBody = mEMailBody & "<table border='0' cellspacing='1'
cellpadding='1' width='400'>"
mEMailBody = mEMailBody & "<tr><td><b>Component</b></td><td align='right'>
<b>£</b></td></tr>"
For mComponentLoop = 1 to mComponentCount
mEMailBody = mEMailBody & "<tr>"
mEMailBody = mEMailBody & "<td>" & Request.Form("Component" &
mComponentLoop) & "</td>"
mEMailBody = mEMailBody & "<td align='right'>" & Request.Form
("ComponentPrice" & mComponentLoop) & "</td>"
mEMailBody = mEMailBody & "</tr>"
Next
mEMailBody = mEMailBody & "<tr><td align='right'><b>Total:</b></td><td>£" &
Request.Form("ComponentPriceTotal") & "</td></tr>"
mEMailBody = mEMailBody & "</table>"
Response.Write mEMailBody
Response.Write "<form method='post' action='SendEMail2.asp'>"
Response.Write "Name:<input type='text' name='Name' value='' /><br />"
Response.Write "EMail Address:<input type='text' name='EMail' value='' /
<br/>"
Response.Write "Tel No:<input type='text' name='Tel' value='' /><br />"
Response.Write "<input type=""hidden"" name=""Recipient""
value=""(e-mail address removed)"" /><br />"
Response.Write "<input type=""hidden"" name=""BodyText"" value=""" &
mEMailBody & """ />"
Response.Write "<input type=""submit"" value="" Send EMail "" /><br />"
Response.Write "</form>"
End If
%>