• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

smtp host in java mail program

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Sheriff
Posts: 6920
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic