469,267 Members | 1,643 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,267 developers. It's quick & easy.

Variable is undefined: 'JMail' help?

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=""em***@actualremoved.com"" /><br />"
Response.Write "<input type=""hidden"" name=""BodyText"" value=""" &
mEMailBody & """ />"
Response.Write "<input type=""submit"" value="" Send EMail "" /><br />"
Response.Write "</form>"

End If
%>
Jul 19 '05 #1
4 4225
Looks like you've forgotten to Dim JMAIL which is probably the cause of the
error.

--

Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!

Disclaimer:
I know I'm probably wrong, I just like taking part ;o)
Kingdom <ki*****@removehotmail.com> wrote in message
news:Xn**********************************@194.117. 133.134...
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=""em***@actualremoved.com"" /><br />"
Response.Write "<input type=""hidden"" name=""BodyText"" value=""" &
mEMailBody & """ />"
Response.Write "<input type=""submit"" value="" Send EMail "" /><br />"
Response.Write "</form>"

End If
%>

Jul 19 '05 #2
"Steven Burn" <nobody@PVT_it-mate.co.uk> wrote in
news:uF**************@tk2msftngp13.phx.gbl:
Looks like you've forgotten to Dim JMAIL which is probably the cause
of the error.

--

Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!

Disclaimer:
I know I'm probably wrong, I just like taking part ;o)
Kingdom <ki*****@removehotmail.com> wrote in message
news:Xn**********************************@194.117. 133.134...
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=""em***@actualremoved.com"" /><br />"
Response.Write "<input type=""hidden"" name=""BodyText"" value=""" &
mEMailBody & """ />"
Response.Write "<input type=""submit"" value="" Send EMail "" /><br
/>" Response.Write "</form>"

End If
%>



yup, thanks
Jul 19 '05 #3
> yup, thanks

Wow, I scrolled all the way down for that?

The delete key is your friend, really. :-)
Jul 19 '05 #4
Aaron,

I love reading your posts. I get a chuckle from you almost
everytime I check in here.

Keep up the good work!

John
-----Original Message-----
yup, thanks


Wow, I scrolled all the way down for that?

The delete key is your friend, really. :-)
.

Jul 19 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Lasse Edsvik | last post: by
reply views Thread by BDKiii | last post: by
2 posts views Thread by rourou | last post: by
8 posts views Thread by Mangler | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.