Reputation: 646
I can compile my code but not execute. What could be the reason and how should i sort it
I get the following run-time errors.
C:\>java SMTPClient Exception in thread "main" javax.mail.MessagingException: Could not connect to S MTP host: smtp.mail.yahoo.com, port: 465; nested exception is..................etc</b></code>
Upvotes: 1
Views: 211
Reputation: 29971
The JavaMail FAQ has instructions for connecting to Yahoo mail, as well as debugging tips for when it doesn't work.
Upvotes: 2
Reputation: 6656
probably SMTPClient uses a SMTP protocol, but yahoo uses more secure one like ASMTP. can you post your SMTPClient class here?
Upvotes: 2
Reputation: 3677
Please provide the root cause
or Stack trace
of the Exception.
It may be because you haven't configured Authenticator
Upvotes: 2
Reputation: 70748
The reason is that it cannot connect to the Yahoo Mail Server. I'm unsure of Yahoo's mail port so ensure that the port is correct. Can you post more details? I.e. the nested exception....
Upvotes: 1