On 5 February 2012 16:00, sebb <[email protected]> wrote: > The recent changes to MailerModel to support port and authentication > aren't implemented in quite the same way as the MailReaderSampler > (however, they are more similar to SendMailCommand). > > In MailReaderSampler, the port is not saved in the properties, but is > provided in the Store#connect() method call. > > This is closer to the example in the JavaMail API documentation. > > Perhaps we should consider using the same method; it's less reliant on > poorly documented property names (AFAICT, mail.smtp.port is only > documented in the Javadoc for com.sun.mail.smtp, which is a > vendor-specific class).
Turns out that it does not apply here, because the code is using Transport.send() which manages its own connection internally. > Note that the properties should always be set as Strings, even if they > are interpreted as int, so the port needs to be set as a String. I > think it's currently set as an Integer (boxed from int). I've fixed that. > In the longer term, maybe we should consider sharing some code between > SmtpSampler and MailerModel; both create and send messages over SMTP. This may still be worth doing; also should at least share the property names as constants in a common class.
