Package com.kheops.jmap.server
Class MailService
java.lang.Object
com.kheops.jmap.server.MailService
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic void
mailMap
(String from, String recipients, String subject, String bodyText, String lang, String imageFormat, byte[] image) static void
mailMap
(String from, javax.mail.Address[] addresses, String subject, String bodyText, String lang, String imageFormat, byte[] image) static void
Sends a text email to the specified recipients.static void
sendMail
(javax.mail.Address[] to, String subject, String message, javax.mail.Address from, String host, short port, int encryption, String smtpUsername, String smtpPassword) Sends a text email to the specified recipients.static javax.mail.Address[]
toAddresses
(String recipients) Converts a string containing email addresses separated by ';' to Address instances
-
Method Details
-
mailMap
public static void mailMap(String from, String recipients, String subject, String bodyText, String lang, String imageFormat, byte[] image) throws Exception - Throws:
Exception
-
mailMap
public static void mailMap(String from, javax.mail.Address[] addresses, String subject, String bodyText, String lang, String imageFormat, byte[] image) throws Exception - Throws:
Exception
-
sendMail
public static void sendMail(javax.mail.Address[] to, String subject, String message, javax.mail.Address from) throws Exception Sends a text email to the specified recipients. Uses the existing connection to SMTP server as configured in JMapServer.- Parameters:
to
- Recipient addressessubject
- The subject of the messagemessage
- The text of the messagefrom
- Sender address- Throws:
Exception
-
sendMail
public static void sendMail(javax.mail.Address[] to, String subject, String message, javax.mail.Address from, String host, short port, int encryption, String smtpUsername, String smtpPassword) throws Exception Sends a text email to the specified recipients. Uses the specified SMTP host, port and encryption- Parameters:
to
- Recipient addressessubject
- The subject of the messagemessage
- The text of the messagefrom
- Sender addresshost
- The SMTP hostport
- The SMTP portencryption
- The SMTP EncryptionsmtpUsername
- The SMTP usernamesmtpPassword
- The SMTP password (not encrypted)- Throws:
Exception
-
toAddresses
public static javax.mail.Address[] toAddresses(String recipients) throws javax.mail.internet.AddressException Converts a string containing email addresses separated by ';' to Address instances- Parameters:
recipients
- the string containing the addresses- Returns:
- an array of instances of Address
- Throws:
javax.mail.internet.AddressException
-