SMTP just runs under the same hostname, in your case box.profitabit.club. The port is correct. The username is your full email address.
You also need to make sure that the envelope sender (From:) is explicitly set, and that this matches the exact email address you used to login (or any associated aliases), otherwise your program seems successful, but postfix will queue the message and drop it right afterwards, so no email will get through.
//Get the session object
Properties props = new Properties();
props.put(“mail.smtp.host”,host);
props.put(“mail.smtp.auth”, “true”);
props.put(“mail.smtp.starttls.enable”, “true”);
props.put(“mail.smtp.host”, “box.profitabit.club”);
props.put(“mail.smtp.port”, “587”);
MailSSLSocketFactory sf = null;
try {
sf = new MailSSLSocketFactory();
} catch (GeneralSecurityException e) {
e.printStackTrace();
}
sf.setTrustAllHosts(true);
props.put(“mail.smtp.ssl.trust”, “*”);
props.put(“mail.smtp.ssl.socketFactory”, sf);
Session session = Session.getDefaultInstance(props,
new javax.mail.Authenticator() {
protected PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication(user,password);
}
});
session.setDebug(true);
//Compose the message
try {
MimeMessage message = new MimeMessage(session);
message.setFrom(new InternetAddress(user));
message.addRecipient(Message.RecipientType.TO,new InternetAddress(to));
message.setSubject(“ProfitAbit Welcomes you.”);
message.setText(“We at last manage to send you request. I hope you will enjoy our service and our platform.”);
//send the message
Transport.send(message);
out.println("message sent successfully...");