Skip to content

daihan054/Email-sending-using-java-code

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Email Sending Using Microsoft Exchange Server and SMTP

This is a basic code for sending mail via EWS and SMTP

EWS - Microsoft Exchange Server

Required jars

The following jars should be added in the project build path

  • commons-codec-1.9.jar
  • commons-lang3-3.4.jar
  • commons-logging-1.2.jar
  • ews-java-api-2.0.jar
  • httpclient-4.4.1.jar
  • httpcore-4.4.1.jar
  • joda-time-2.8.jar

Necessary credentials

  • Email id which is used to open microsoft account
  • That microsoft account password

SMTP

Required jars

The following jars should be added in the project build path

  • javax.mail.jar
  • smtp-1.4.5.jar

Necessary credentials

  • gmail id
  • gmail id's password

A very important point to understand

In my EmailMessenger.java code in line number 121 there has a line

message.setFrom(new InternetAddress(this.smtpFrom, "National University of Singapore")); // from , view

if we use the 121 line's code

View before opening the mail will be as bellow: renameEmail group 1 2

View after opening the mail will be as bellow: renameEmail group 1 1

if we don't use the 121 line's code

View before opening the mail will be as bellow: renameEmail 2 1

Basically daihan.work is the username which is displayed before opening the mail. This is what we actually see as usual .

View after opening the mail will be as bellow: renameEmail 2 2

References

  1. ews - Stackoverflow
  2. smtp - Stackoverflow

About

This is a basic code for sending mail via EWS and SMTP

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages