This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
I m a bit confused on setting SMTP host while sending email thru my java mail program. What I do is: 1.Properties props = new Properties(); props.put("mail.smtp.host", "smtp.softhome.net"); 2.I get the following console output: DEBUG: getProvider() returning javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.s mtp.SMTPTransport,Sun Microsystems, Inc] DEBUG SMTP: useEhlo true, useAuth false DEBUG: SMTPTransport trying to connect to host "smtp.softhome.net", port 25 javax.mail.SendFailedException: Sending failed; nested exception is: javax.mail.MessagingException: Could not connect to SMTP host: smtp.softhome.net, port: 25; nested exception is: java.net.SocketException: no further information (code=10051) at javax.mail.Transport.send0(Compiled Code) at javax.mail.Transport.send(Transport.java:81) at Mail.sendMail(Mail.java:35) at MailMessage.main(MailMessage.java:229)
I might be using wrong smtpHost. I use softhome.net as my POP server and I can pop mails from softhome.net to my outlookexpress (win98). But for some reason I m not able to send mails from outlook thru this POP. I read on softhome that some ISP block port #25 to check spamming. I connect to internet via netzero and worldnet.att.net but in vain. Incidentally, when I was in india and my ISP was jp1.dot.net.in and I could send mail thru the same javaMail program using "props.put("mail.smtp.host", "jp1.dot.net.in");" Even I used to POP mail from softhome.net into my outlook.
You need to look at your outlook settings for the SMTP host instead of the POP3 host. The fact that a system offers POP3 (or IMAP) says nothing about whether it also offers SMTP. Typically POP3 or IMAP are used by you to collect mail which has been sent to you, while SMTP is used by you to send mail. If you can successfully send mail from outlook, then outlook must be set up with a valid SMTP host, you just need to find out what it is.