Sending email using pure Java using an SMTP connection to a Microsoft Exchange Server -- 2

Job ID: 31922480

Budget: $45 – $75 USD

This is a repost of a project completed two years ago.

The code worked until 3 weeks ago when my client migrated their mail services to outlook.office365.com which requires a secure SMTP connection to send mail.

I will post the server information for your review, and for anyone familiar with Java and sending emails, this project will take you a maximum of one hour, and for that reason, I offer a relatively low fixed price, ass all that needs to happen is make this code work over a different connection.

I will attach pictures of the server information for the email account, and upon accepting your offer will send you the current working non-secure source code.

I leave the original post below here ... and don't forget to look at my new attachments here.

Good luck and thanks in advance!

We have been using a deprecated feature of the Windows Server Task Scheduler to send emails, and besides that we only have one server remaining that can do this (this server is running Windows Server 2008 R2 Standard) all our other servers are Windows Server 2012, which doesn't support the 'Send Email' tasks. Furthermore, the emails are TOTALLY STATIC, and I want to dynamically change the "To", "CC", "BCC", "Subject", "Body", etc, which I cannot do.

Your job is to create a single Java class file, to facilitate this (see below, SMTPEmail)

I don't care which set of supporting classes you use, but I found this web article that uses these:

import java.util.*;
import javax.mail.*;
import javax.mail.internet.*;
import javax.activation.*;

https://blog.mailtrap.io/sending-email-using-java/

You are welcome to add additional methods you think will be useful.

Sample use with all methods I want to be implemented.

try {
SMTPEmail e = new SMTPEmail();
e.setSubjectTo("This is our first Java SMTP Email");
e.setBody("wepodkwedpokwed");
e.setHTMLBody("<Header>Stuff</Header>");
e.addAttachment("X:\MyStuff\List.txt");
e.addAttachmentAs("Z:\Images\myPicture.jpeg", "PictureForYou.jpg");
e.doSend();
}
catch ( Exception e )
{
System.out.println(e.toString());
}