bbottema/simple-java-mail

Add support for config files

bbottema opened this issue · 1 comments

Add support for config files, so that the SMTP and proxy server details can be configured there as well as a default subject, cc. bcc, from-address and reply-to-address.

Make the config path configurable, so that you can have different configuration files per environment.

Alright, I've added robust support for loading property files, inpustreams or classpath files.

There are two levels of property files:

  1. default simplejavamail.properties from the classpath. If available, automatically loads properties from there.
  2. Loading manually from classpath file, system file or inpustream

When loading properties manually, you can choose to replace the entire list, or just add the new properties to the existing one.

An example where this might be useful is when you wish to provide defaults in the application and per environment provide more specific values.