How does one connect to SMTP server to send email? I'm getting "recipient address rejected: access denied" and I think its because I'm not specifying login ID and password. When I look in the JavaMail api documentation I see information about how to connect for the purposes of getting pop3 or imap email i.e.
I tried this code but it didn't work. For purposes of writing email how should I connect to the SMTP server with ID and password.
I'm writing a Java App to do this so I don't have (app server) logs to look at. I set the property you suggested (smtp auth true) and I started to get email written (instead of getting address rejected: access denied). Whats odd is that I am still getting
javax.mail.AuthenticationFailedException at javax.mail.Service.connect(Service.java:306) at javax.mail.Service.connect(Service.java:156) at javax.mail.Service.connect(Service.java:105) at qflexAlert.emailESBsupp(qflexAlert.java:57) at qflexAlert.main(qflexAlert.java:17)
but my email is still written out by the SMTP server. I don't understand this.