jmail giving error

Posted on 2006-05-17
Last Modified: 2011-10-03

I am running the attached code

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

JMail.ServerAddress = ""

JMail.Sender = ""
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")


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

Question by:krbnldy
    LVL 7

    Expert Comment

    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
       'provide user with feedback
    end if
    LVL 7

    Expert Comment

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

    Expert Comment

    wat is the use of .(dot) here ?
    JMail.Body = "emailmsg."


    JMail.Body = "emailmsg"

    LVL 7

    Expert Comment

    Well its within the quotes so its just part of the string literal and does not effect code execution. ...2cents...
    LVL 7

    Expert Comment

    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").

    LVL 20

    Expert Comment

    i guess it should be ...
    JMail.Body =  emailmsg

    without qotes ("")
    LVL 25

    Accepted Solution

    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"

    Featured Post

    Courses: Start Training Online With Pros, Today

    Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

    Join & Write a Comment

    I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
    This demonstration started out as a follow up to some recently posted questions on the subject of logging in: and…
    Hi everyone! This is Experts Exchange customer support.  This quick video will show you how to change your primary email address.  If you have any questions, then please Write a Comment below!
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

    754 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

    Need Help in Real-Time?

    Connect with top rated Experts

    23 Experts available now in Live!

    Get 1:1 Help Now