This week's book giveaway is in the OCPJP forum. We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line! See this thread for details.
Exception in thread "main" javax.mail.NoSuchProviderException: Invalid protocol: null at javax.mail.Session.getProvider(Session.java:431) at javax.mail.Session.getTransport(Session.java:650) at javax.mail.Session.getTransport(Session.java:631) at javax.mail.Session.getTransport(Session.java:617) at MailDemo.main(MailDemo.java:25)
It is a simple program to send a plain email... Can anyone help me out
When i made the following correction...now i am getting a different error
Exception in thread "main" java.lang.IllegalStateException: Not connected at com.sun.mail.smtp.SMTPTransport.checkConnected(SMTPTransport.java:151 1) at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:548) at MailDemo.main(MailDemo.java:50)
Instead of trying to use Yahoo's account, why not try to use your ISP provider first and see if you can get that working? Also, the stack trace is showing the error at line 50 of the MailDemo. Which line is that in your code? That will help you pin down the problem.