I am trying to set the SMTP host for JavaMail. I have attempted set the properties in the Application, in the component, and in Resources->Properties. None of these approaches seems to get the props set (per exception at the end of this email).
In the Application() using this code:
public Application() { super(); Properties props = System.getProperties(); //Specify the desired SMTP server props.put( "WOSMTPHost", "smtp.comcast.net" ); props.put( "mail.smtp.host", "smtp.comcast.net" ); }
But when the app starts WO lists only "smtp" as the value of WOSMTPHost.
WOSMTPHost=smtp
Just prior to executing the Transport.send( message ); command I print the system properties and, as expected, these are the values.
WOSMTPHost=smtp.comcast.net mail.smtp.host=smtp.comcast.net
But Transport.send( message ); fails with this exception.
SendFailedException: javax.mail.NoSuchProviderException: smtp
Regards,
Drew |