I have a problem with sending emails via JavaMail from Nuxeo.
My customization contains with a new type that has its own layout. There is one field where I type email addresses. After submitting form, a proper event listener executes code which sends emails to given addresses (JavaMail). SMTP host is taken from mail.smtp.host property. Unfortunately, not all emails are sent. Here's an example situation:
Given addresses: paul.baker@gmail.com, hank.newman@abc.com
- mail.smtp.host property is set to server2003 (which is localhost and has SMTP service configured with Windows Server 2003). Email is sent only to paul.baker@gmail.com
- mail.smtp.host property is set to abc.com (which is the domain provided by web hosting company with SMTP service). Email is sent only to hank.newman@abc.com
I've tried to set SMTP server in java code like this:
if (email.endsWith("abc.com")) {
smtpHost = "abc.com";
} else {
smtpHost = "server2003";
}
sendMail(..., smtpHost, ...)
but Nuxeo seems to force SMTP host which is currently set in nuxeo.conf file.
How can I make Nuxeo send these emails properly?
I'm using Tomcat distribution. Please, let me know if more info is needed.