Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Java Email Client for private email

User_YWIZ9Nov 22 2022

Hi,
Java Email Client for private email is not working. Here's my code. It hangs there. The service provider says their server is fine:
String from = "service@mydomain.us";
final String username = "service";//change accordingly
final String password = "xxxxxx";//change accordingly

// Assuming you are sending email through relay.jangosmtp.net
String host = "mail.privateemail.com";

Properties props = new Properties();
props.put("mail.smtp.auth", "true");
props.put("mail.smtp.starttls.enable", "true");
props.put("mail.smtp.host", host);
props.put("mail.smtp.port", "465");

Anyone tells me what's wrong?

A.

Comments

User_YWIZ9

Dead forum?

justsomeone

Hello @user-ywiz9

to see full sample go to https://javaee.github.io/javamail/#Samples
also you can check this one https://www.courier.com/guides/java-send-email/
or this one https://www.javatpoint.com/example-of-sending-email-using-java-mail-api

hope those help and have a nice day :)

1 - 2

Post Details

Added on Nov 22 2022
2 comments
583 views