Send email In java using smtp

//import jar file from https://mvnrepository.com/artifact/javax.mail/mail/1.4.7
package com.mail.api.controller;

import com.sun.mail.smtp.SMTPTransport;
import java.util.Date;
import java.util.Properties;

import javax.mail.Message;
import javax.mail.MessagingException;
import javax.mail.Session;
import javax.mail.internet.InternetAddress;
import javax.mail.internet.MimeMessage;

public class Mail {
public static boolean sendMail(Email email){
EmailTemplate template = email.getEmailTemplate();
int SMTP_PORT = 465;
final String EMAIL_TO = "";
final String EMAIL_TO_CC = "";
final String EMAIL_TO_BCC = "";
final String EMAIL_SUBJECT = "";
final String EMAIL_TEXT = "";
Properties prop = System.getProperties();
//prop.put("mail.debug", "true");
prop.put("mail.smtp.host", SMTP_SERVER); //optional, defined in SMTPTransport
prop.put("mail.smtp.auth", "true");
prop.put("mail.smtp.socketFactory.port",SMTP_PORT);
prop.put("mail.smtp.socketFactory.class","javax.net.ssl.SSLSocketFactory");
prop.put("mail.smtp.socketFactory.fallback", "false");
prop.put("mail.smtp.starttls.enable", "true");
prop.put("mail.smtp.ssl","true");
prop.put("mail.smtp.port", SMTP_PORT); // default port 25

Session session = Session.getInstance(prop, null);
Message msg = new MimeMessage(session);

try {
msg.setFrom(new InternetAddress(EMAIL_FROM));
msg.setRecipients(Message.RecipientType.TO,InternetAddress.parse(EMAIL_TO, false));
msg.setRecipients(Message.RecipientType.CC,InternetAddress.parse(EMAIL_TO_CC, false));
msg.setRecipients(Message.RecipientType.BCC,InternetAddress.parse(EMAIL_TO_BCC, false));

msg.setSubject(EMAIL_SUBJECT);
msg.setContent(EMAIL_TEXT,"text/html");
msg.setSentDate(new Date());
// Get SMTPTransport
SMTPTransport t = (SMTPTransport) session.getTransport("smtp");
t.connect(SMTP_SERVER, SMTP_USERNAME, SMTP_PASSWORD);
t.sendMessage(msg, msg.getAllRecipients());
System.out.println("Response: " + t.getLastServerResponse());
t.close();
return true;
} catch (MessagingException e) {
e.printStackTrace();
}
return false;
}
}