email - Java Mail Using Own Mail Server -
i've tried various codes online , experimenting own keeps throwing exception instead of sending email. sending manually works fine though. wrong?
tls:
exception in thread "main" java.lang.runtimeexception: com.sun.mail.util.mailconnectexception: couldn't connect host, port: smtp.gmail.com, 587; timeout -1;
ssl:
exception in thread "main" java.lang.runtimeexception: com.sun.mail.util.mailconnectexception: couldn't connect host, port: smtp.gmail.com, 465; timeout -1;
obviously can reach mail server using ping
on cmd , i'm connected internet.
alternatively, how can setup own mail server allow messaging without authentification instead of restricted public mail service? preferably free solution.
this not authentication problem, can not connect port. port commonly blocked in endpoint firewalls, including windows firewall. remember these block specific applications, might java can not connect outwards.
running private mail exchanger... not ideal solution problem. realistically, have mail delivered inbox instead of spam folder, private server forward other public mail server. @ best handle authentication stuff local clients (and possibly become enormous spam relay @ same time). if still want it, postfix excellent choice.
Comments
Post a Comment