Is it possible to overwrite the domain which an email will come from via a property?
Currently I'm using setFrom(InternetAddress)
on javax.mail.Message and then executing via :
message.setFrom(new InternetAddress("[email protected]"));
However I need x.co.uk to be configurable per environment. I was hoping I could do this automatically via a property on the JNDI?
- Is there a mail.x property for setting the domain?
- Is it possible to declare arbitrary properties on a JNDI Resource?
I don't think you can override where you come from with the API. It's for security reason. Technically you can. But you shouldn't do it.