1 Reply Latest reply: Nov 6, 2011 1:16 PM by Bill Shannon-Oracle RSS

    javamail config based on outlook

      Hi all,

      I wrote send message code using JavaMail. It works ok with a gmail account I created for testing.
      String protocol = Settings.getInstance().smtpSsl ? "smtps" : "smtp";
      Properties props = new Properties();
      if( Settings.getInstance().smtpAuth)
          props.put("mail." + protocol + ".auth", "true");
      Session session = Session.getDefaultInstance(props, null);
      // setup message
      Transport t = session.getTransport( protocol);
      t.connect( Settings.getInstance().smtpHost, 
      t.sendMessage( msg, msg.getAllRecipients());
      Unfortunately t.connect() fails (timeout) when trying to connect to the company SMTP server. At the same time my Outlook can send messages using this server. Outlook config looks pretty simple: default port 25, no SSL.

      Any ideas how to modify my code to reproduce successful Outlook configuration?