5.12 SMTPMailService
The SMTPMailService supports sending email using the Simple Mail Transfer Protocol (SMTP) through an existing mail server. Most email systems that send mail over the internet use the SMTP protocol to send messages from one server to another. SMTP specifies how the two mail systems need to interact and the format of the control messages they exchange to transfer mail.
When generating email messages using the SMTPMailService, applications can specify a wide range of properties such as recipient and sender addresses, subject and body text, content type and character encoding. Applications can add multiple attachments and, optionally, specify that they are to be collected into a single zip archive file to attach to the outgoing message. The service also supports a variety of encryption techniques.
The SMTPMailService uses the Oracle JavaMail API.
Refer to http://www.oracle.com/technetwork/java/javamail/index.html.
Related Services
The SMTPMailService is not dependent on other services but is typically used in conjunction with the POP3MailService if messages are also to be received by the application.
The SMTPMailService can be used to create and send an email message to another server, but since the SMTP protocol is limited in its ability to queue messages at the receiving end it is usually used in conjunction with one of two email client protocols, POP3 or IMAP. If the email client is using JSM services to retrieve the email message then the POP3MailService can be used to retrieve any email messages. The POP3MailService facilitates the saving of messages in a server mailbox and periodic downloading of messages from the server.
Technical Specifications
- Typically the domain information (server, ports and maildomain) and from address are defined in the SMTPMailService properties file unless the default values are being used. This ensures a consistent use of the properties and avoids the need to declare this information each time the service is used.
- SMTP is usually configured to operate over TCP port 25.
To support encrypted emails set up the SMTPMailService property with the appropriate recipient and security file details:
recipient.certificate.<person>=<public certificate file>
- To support signed emails the SMTPMailService properties file must identify the private key store file and public certificate needed by the SMTPMailServer. The following signer properties must be specified for the email recipient:
signer.keystore.<signer>=<private key store file>
signer.certificate.<signer>=<public certificate file>