public class Mailer extends Object
| Constructor and Description |
|---|
Mailer() |
| Modifier and Type | Method and Description |
|---|---|
static javax.mail.Session |
getMailSession() |
static void |
sendMail(String fromName,
String fromEmail,
String email,
String subject,
String mailContent)
Sends a mail with an attachment enclosed
|
static void |
sendMail(String fromName,
String fromEmail,
String email,
String subject,
String mailContent,
File attachment,
String filename)
Sends a mail with an attachment enclosed
|
static void |
sendMail(String fromName,
String fromEmail,
String email,
String subject,
String mailContent,
String cc)
Sends a mail with an attachment enclosed
|
public static void sendMail(String fromName, String fromEmail, String email, String subject, String mailContent) throws Exception
fromName - The name which should be display as the sender.fromEmail - The replyaddressemail - To which address(es) the mail should be sent, comma separated string for multiple addressessubject - Subject of the mailmailContent - The content of the messageException - if anypublic static void sendMail(String fromName, String fromEmail, String email, String subject, String mailContent, String cc) throws Exception
fromName - The name which should be display as the sender.fromEmail - The replyaddressemail - To which address(es) the mail should be sent, comma separated string for multiple addressessubject - Subject of the mailmailContent - The content of the messagecc - A cc address, comma separated string for multiple cc addressesException - if anypublic static void sendMail(String fromName, String fromEmail, String email, String subject, String mailContent, File attachment, String filename) throws Exception
fromName - The name which should be display as the sender.fromEmail - The replyaddressemail - To which address(es) the mail should be sent, comma separated string for multiple addressessubject - Subject of the mailmailContent - The content of the messageattachment - The attachment to be sentfilename - Give that attachment a naem.Exception - if anyCopyright © 2020. All rights reserved.