Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

I need some help javax.mail.MessagingException: Unknown SMTP host: localhost:9090;

Discussion in 'E-mail Discussion' started by thompson, Mar 15, 2011.

  1. thompson

    thompson Registered

    Feb 10, 2011
    Likes Received:
    Trophy Points:
    I developed a webapp that runs in a remote server and send E-mails when a event happen It was working for 4 weeks and out of blue I got an error.

    javax.mail.MessagingException: Unknown SMTP host: localhost:9090;

    I am using

    - JBoss 4.2.3
    - Mail Server:

    My code is the following

    String to = ""; // email that receive the feedback
    String from = email; // email that send the feedback
    String host = "";
    String stmp = "";

    // Get system properties
    Properties properties = System.getProperties();
    // Setup mail server
    properties.setProperty(stmp, host);
    // Get the default Session object.//
    Session session = Session.getInstance(properties, null);
    // Create a default MimeMessage object.
    MimeMessage message = new MimeMessage(session);

    // Set From: header field of the header.
    message.setFrom(new InternetAddress(from));

    // Set To: header field of the header.
    message.addRecipient(Message.RecipientType.TO,new InternetAddress(to));

    // Set Subject: header field

    // Now set the actual message

    // Send message
    System.out.println("Sent message successfully....");
    }catch (MessagingException mex) {

    Please help me


Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice