I can authenticated to SMTP by following the google example.
But the problem now is I can\'t send out the mail. I am getting the following error whenever I try to se
I think so it is asking for authentication of your username.
session=Session.getInstance(props,
new javax.mail.Authenticator() {
protected PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication(fromUsername, password);
}
});
And then use above session in your code.
I haven't use the code specified in the google link u mentioned but i use java mail api to send email from my gmail account.Use above code for authentication