Link to home
Start Free TrialLog in
Avatar of jamesh1031
jamesh1031Flag for United States of America

asked on

jmail HTTP 500 error

I am getting a HTTP 500 error using jmail. I had jmail working at one time, don't know what has changed. It did work once upon a time. This is a co-located server. Here is my code:

<%

'NOTE: YOU MUST UPDATE THE FOLLOWING 3 VARIABLES
Dim strMailDomain, strMailUserName, strMailPassword

strMailDomain = "xxx.xx.com"
strMailUserName = "abc@abc.com"
strMailPassword = "mailpassword"


' Get the form data from HTML form with 6 fields
Dim name, senderEmail,telephone,subject,recipient,body

name = Request.Form("name")
senderEmail = Request.Form("email")
telephone = Request.form("telephone")
subject = "Regarding " & Request.Form("subject")
recipient = Request.Form("recipient")
body = Request.Form("body")

'Response.write name

' Create the JMail message Object
Dim msg
set msg = Server.CreateOBject( "JMail.Message" )


' Enter the sender data
msg.From = xxx@xxx.com
msg.FromName = xxx

'Server Authentication
msg.MailServerUserName = strMailUserName
msg.MailServerPassWord = strMailPassword



' Note that as addRecipient is method and not
' a property, we do not use an equals ( = ) sign
msg.AddRecipient "xxx@xxx.com"
msg.AddRecipientCC "xxx@xxx.com"
msg.AddRecipientBCC ""

' The subject of the message
msg.Subject = subject

' And the body
msg.body = body

Response.write msg.log

' Now send the message, using the indicated mailserver
if not msg.Send(strMailDomain) then
Response.write "<pre>" & msg.log & "</pre>"
else
Response.write "Thank you for taking the time to contact us. <br /><br />We will reply as soon as possible, often the same day."
end if

'Response.write msg.log
'Response.write "a"
' That's it - you can add additional e-mail addresses as required.

%>
ASKER CERTIFIED SOLUTION
Avatar of B_Dorsey
B_Dorsey

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jamesh1031

ASKER

Microsoft VBScript compilation error '800a0400'

Expected statement

/jmail.asp, line 5

Option Explicit
^
By seeing the line of the error, I was able to make progress. Thank you.