Used API: JavaMail API Site: http://www.oracle.com/technetwork/java/javamail/
- You will need Apache Maven to open this project.
- Please Check out Maven Plugin for Eclipse.
- No GUI is provided.
-
All Java Files are placed in:
{$PROJECT_ROOT}/mailClient/src/main/java/crazystudio/mailClient/*.java -
Configure
App.java- Set Mail Subject at LINE 15
- Set Mail Content at LINE 18
- Set Recipient at LINE 22 (Under
//Set Recipient)- Use
recipients.add("EMAIL_ADDRESS");to set multiple recipients.
- Use
- Set BCC at LINE 28 (Under
//Set BCC)- Use
recipients.bcc("EMAIL_ADDRESS");to set multiple bccs.
- Use
- Set Attachments at LINE 34 (Under
//Set Attachment Path)- Use
attachments.add("FULL_PATH_OF_THE_FILE");to set multiple attachments.
- Use
-
MailCore.javaSet yourusernameandpassword(LINE 14, 15) for the selectedhost(LINE 12). -
You will get a message
Successfully sent.inside the console if the mail is sent successfully.