This week's book giveaways are in the Scala and Android forums.
We're giving away four copies each of Machine Learning Systems: Designs that scale and Xamarin in Action: Creating native cross-platform mobile apps and have the authors on-line!
See this thread and this one for details.
Win a copy of Machine Learning Systems: Designs that scale this week in the Scala forum
or Xamarin in Action: Creating native cross-platform mobile apps in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Help me please, JavaMail  RSS feed

 
clojure forum advocate
Bartender
Posts: 3479
Clojure Mac Objective C
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys.
I have wrote a simple Java class to send an email to "johntodd@lycos.com"
address from the "johntodd@linuxmail.org" adress.

but I have got the following exceptions :
MessagingException : could not connect to SMTP host mail.lycos.com, port 25
nested exception is : SocketException : Network is unreachable
so, is mail.smtp.host property refers to the reciever host or to sender host ??
is every smtp mail server has the following format : mail.smtp.host
like : mail.smtp.yahoo or mail.yahoo.com ??
please, I need help, because JavaMail is a vital subject me....
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
SMTP name is for the Send Mail Transport Protocol** -- It's the name of a host that will send your message. Take a peek in your regular email program options and you'll probably see the info you need to plug. If that doesn't help perhaps you could discuss with a network admin or whoever set up your email for the correct SMTP (aka SendMail) address.
PKNH
** exact acronym I'm not sure -- could be Send Mail Transport Program but you get the idea. PKNH
 
Ranch Hand
Posts: 532
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi John:
I just have a question for you. Why are you using Session.getDefaultInstance() method as oppose to Session.getInstance(). When you use getDefualtInstance it return a Session object that is shared among all application running in the same JVM. Isn't a security hole? for example, if another application reset the security parameters on the defualt Session instance, then your application will not be able to access it anymore.
I am not criticising your choice, I just want to know why?
thanks
 
Ranch Hand
Posts: 140
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


SMTP name is for the Send Mail Transport Protocol
...
exact acronym I'm not sure -- could be Send Mail Transport Program but you get the idea. PKNH


*Ahem* - its actually Simple Mail Transfer Protocol (See RFC 821 which defines it). I could also point out its not an acronym, but I might get thrown out of the forum for being far too smug...
 
I have always wanted to have a neighbor just like you - Fred Rogers. Tiny ad:
Rocket Oven Kickstarter - from the trailboss
https://coderanch.com/t/695773/Rocket-Oven-Kickstarter-trailboss
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!