Note that there are some explanatory texts on larger screens.

plurals
  1. POjavaMail send email over MSExchange
    text
    copied!<p>I have a web site that send mails using javaMail library, <strong>that works fine until we changed the mail service to MSExchange</strong>.</p> <p>I recompiled the project setting the new host configuration and testing in my computer and work fine using GlassFish, Then I try it on testing server in glassfish too. When I deploy the application in producction don't work, the log don't show me any error, there are some diference between dev/testing enviroment and production, first dev and testing is over the network 10.226.xxx.xxx and production 192.168.xxx.xxx and in producction we have a tomcat.</p> <p>I sended an email in production server using telnet conecting to smtp and works fine.</p> <p>I realy lost, I don't know how (and what) to fix it...</p> <pre><code>try { Byte newMailStatus = 0; SimpleMailMessage msg = new SimpleMailMessage(this.templateMessage); msg.setSubject("Hi!"); msg.setText("xxx"); try { this.mailSender.send(msg); newMailStatus = 1; } catch (MailException ex) { log.error(ex.getMessage()); newMailStatus = 0; } ALimitResult result = new ALimiteResult(); result.setStatus(newMailStatus); getModel().put("model", result); ModelAndView modelView = new ModelAndView("EmailView", getModel()); return modelView; } catch (Exception e) { log.error(e.getMessage()); return null; } </code></pre> <p>(SMTP server authentication is disabled)</p> <pre><code>&lt;bean id="mailSender" class="org.springframework.mail.javamail.JavaMailSenderImpl"&gt; &lt;property name="host" value="exchange.mydomain.com" /&gt; &lt;property name="username" value="email@mydomain.com" /&gt; &lt;property name="password" value="helpme" /&gt; &lt;property name="javaMailProperties"&gt; &lt;props&gt; &lt;prop key="mail.smtp.auth"&gt;false&lt;/prop&gt; &lt;/props&gt; &lt;/property&gt; &lt;/bean&gt; </code></pre> <p>NEW: In production server I get this error:</p> <p>2011-09-07 10:30:58,248 ERROR [xxx-myController] - Authentication failed; nested exception is javax.mail.AuthenticationFailedException: No authentication mechansims supported by both server and client</p> <p>I made a "ehlo" to get the authentication methods on the SMTP server, I get this:</p> <ul> <li>250-svrexch.mydomain.com Hello [192.168.1.10]</li> <li>250-SIZE 10485760</li> <li>250-PIPELINING</li> <li>250-DSN</li> <li>250-ENHANCEDSTATUSCODES</li> <li>250-STARTTLS</li> <li>250-AUTH</li> <li>250-8BITMIME</li> <li>250-BINARYMIME</li> <li>250-CHUNKING</li> <li>250-XEXCH50</li> <li>250 XSHADOW</li> </ul>
 

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