?
Solved

jmail giving error

Posted on 2006-05-17
7
Medium Priority
?
341 Views
Last Modified: 2011-10-03
Hi

I am running the attached code

Set JMail = Server.CreateObject("JMail.SMTPMail")

JMail.ServerAddress = "mail.onestopcaribbeanshop.com"

JMail.Sender = "admin@onestopcaribbeanshop.com"
JMail.Subject = "Classical Concierge event request confirmation"

' Get the recipients mailbox from input form.
JMail.AddRecipient Request.Form("emailaddress")
JMail.Body = "emailmsg."

'JMail.AddHeader "Originating-IP", Request.ServerVariables("REMOTE_ADDR")

JMail.Execute

and getting the following error

jmail.SMTPMail error '8000ffff'

The message was undeliverable. All servers failed to receive the message


the hosting site says the server is configured correctly,  Please help.  I need to complete this by tonight


0
Comment
Question by:krbnldy
  • 4
  • 2
7 Comments
 
LVL 7

Expert Comment

by:chisholmd
ID: 16705740
I can see a few things wrong.  First your not checking your parameters, second your not handling exceptions.

Check that Request.Form("emailaddress") contains the value you expect it to.  You should do this in production as well , not just to test the script.    Also, I would use an on error resume next... on error goto 0  around your mailer code to be able to give the user a soft landing.

Something like...

<%

function validEmail(inVal)  'as boolean
   'use regExp to check if passed string is a valid email address
end function

if validEmail(Request.Form("emailaddress")) then
   on error resume next
   ....mailer code....
   if err.number <> 0 then
         'there was a problem give feedback to user
   end if
   on error goto 0
else
   'provide user with feedback
end if
0
 
LVL 7

Expert Comment

by:chisholmd
ID: 16705742
Oh ya, I suspect that if you do they above you'll also find the problem that is causing your specific error message.
0
 
LVL 20

Expert Comment

by:Gawai
ID: 16705838
wat is the use of .(dot) here ?
JMail.Body = "emailmsg."

just

JMail.Body = "emailmsg"


0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
LVL 7

Expert Comment

by:chisholmd
ID: 16705928
Well its within the quotes so its just part of the string literal and does not effect code execution. ...2cents...
0
 
LVL 7

Expert Comment

by:chisholmd
ID: 16705936
Also, check to see if your mail server requires authentication, it should and if it does you'll need to set the username password properties of that object (if it has them some shockingly don't or they make it part of the "paid version").

0
 
LVL 20

Expert Comment

by:Gawai
ID: 16708266
i guess it should be ...
JMail.Body =  emailmsg

without qotes ("")
0
 
LVL 25

Accepted Solution

by:
kevp75 earned 280 total points
ID: 16708410
your code should be something like this:
set msg = createobject( "JMail.Message" )
                  msg.silent = true
                  msg.From = fromEmail
                  msg.AddRecipient toEmail
                  msg.Subject = subject
                  msg.Body = content
                  
                  'For HTML Emails uncomment the following line
                  msg.ContentType = "text/html"
                  
                  'If your server needs authentication, un-comment the following 2 lines and replace the necessary
                  'msg.MailServerUserName = "YOUR USERNAME"
                  'msg.MailServerPassword = "YOUR PASSWORD"
                  
                  msg.Send(smtpserver)
0

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:   The Exchange of informatio…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
This video tutorial shows you the steps to go through to set up what I believe to be the best email app on the android platform to read Exchange mail.  Get the app on your phone: The first step is to make sure you have the Samsung Email app on your …
In this video I will demonstrate how to set up Nine, which I now consider the best alternative email app to Touchdown.

599 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question