mkarthik415
asked on
java mail
code for a simple to programe to send a mail using javamail api
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
After running the project with above code as java applicatioin I getting this exception
selecting username and password
Exception in thread "main" javax.mail.MessagingExcept ion: Could not connect to SMTP host: smtp.gmail.com, port: 465, response: -1
at com.sun.mail.smtp.SMTPTran sport.open Server(SMT PTransport .java:1694 )
at com.sun.mail.smtp.SMTPTran sport.prot ocolConnec t(SMTPTran sport.java :525)
at javax.mail.Service.connect (Service.j ava:291)
at javax.mail.Service.connect (Service.j ava:172)
at javax.mail.Service.connect (Service.j ava:121)
at javax.mail.Transport.send0 (Transport .java:190)
at javax.mail.Transport.send( Transport. java:120)
at MailWithPasswordAuthentica tion.run(M ailWithPas swordAuthe ntication. java:26)
at MailWithPasswordAuthentica tion.main( MailWithPa sswordAuth entication .java:14)
selecting username and password
Exception in thread "main" javax.mail.MessagingExcept
at com.sun.mail.smtp.SMTPTran
at com.sun.mail.smtp.SMTPTran
at javax.mail.Service.connect
at javax.mail.Service.connect
at javax.mail.Service.connect
at javax.mail.Transport.send0
at javax.mail.Transport.send(
at MailWithPasswordAuthentica
at MailWithPasswordAuthentica
ASKER
ty
ASKER
Thank you very much for your replies. I am using this code to send mail through java, but I have not received any mails. I have got no exceptions also.
TY
Open in new window