Note that there are some explanatory texts on larger screens.

plurals
  1. POJavaMail SMTPSendFailedException
    primarykey
    data
    text
    <p>I am writing a bulk email program using the JavaMail api. I have a Microsoft Exhange server which I am trying to send the emails in to. When I run my program I get the following error:</p> <pre><code>**com.sun.mail.smtp.SMTPTransport.issueSendCommand(SMTPTransport.java:2057) at com.sun.mail.smtp.SMTPTransport.finishData(SMTPTransport.java:1862) at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:1100) at javax.mail.Transport.send0(Transport.java:195) at javax.mail.Transport.send(Transport.java:124) at SendEmail.postMail(SendEmail.java:100) at EmailGenerator.main(EmailGenerator.java:52)** </code></pre> <p>The part of my code trying to send the message is as follows:</p> <pre><code>Properties props = new Properties(); props.put("mail.smtp.host", email_server); props.put("mail.transport.protocol", "smtp"); props.put("mail.smtp.auth", true); class EmailAuthenticator extends Authenticator { String user; String pw; EmailAuthenticator (String FROM, String PASSWORD) { super(); this.user = FROM; this.pw = PASSWORD; } public PasswordAuthentication getPasswordAuthentication() { return new PasswordAuthentication(user, pw); } } Session session = Session.getInstance(props, new EmailAuthenticator(USER, PASSWORD)); session.setDebug(debug); System.out.println("Session created"); .. CREATED MESSAGE HERE... Transport transport = session.getTransport("smtp"); transport.connect(exchange_server,user,password); transport.send(msg); transport.close(); </code></pre> <p>I wonder am I missing some configuration on the Exchange server side, or is an issue with my code?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload