Help coderanch get a
new server
by contributing to the fundraiser
  • 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
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

how to know about my mail's smtp syntax

 
clojure forum advocate
Posts: 3479
Mac Objective C Clojure
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi.
I have an account on Lycos.com, and I want to send an email to it through my Java class.
I know, I have to set the mail.smtp.host property.
but how can I know lycos's smtp host ?
is there a specific syntax for all mail providers , like :
mail.smtp.yahoo.com or smtp.yahoo.com ??
and if I am behind a proxy, what should I do ?
----------
another question please:
when we use our mail accounts, and we want to send an email we write in the specific fields:
FROM : johntodd@lycos.com
TO : friend1@hotmail.com, friend2@yahoo.com, friend3@myway.com
then we press Send button to send the mail.
how the mail application knows each mail.smtp.host property for each provider ?
 
Ranch Hand
Posts: 299
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You only need to know of a single SMTP server that YOU are allowed to send mail through. That SMTP server figures everything else out. Usually this SMTP server is provided to you by your ISP. For example, if you use Earthlink to get online, it might be smtp.earthlink.com. I use RoadRunner in NC so mine is smtp-server.nc.rr.com. BUT...I can only use this SMTP server when I am on the RR network - if I try it from work, it will fail - this helps prevent SPAMmers form using/abusing it.
So, to sum it up, you just need one SMTP server you are allowed to send mail through. All the rest of the details are handled behind the scenes. I did some email in my free (and open source once I get around to posting the code) app nator - http://nator.filenabber.com and I used the emai llibrary from coolservlets.com - http://coolservlets.com/Email/ - small, simple, easy to use, and it works.
brian
 
Ranch Hand
Posts: 140
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


but how can I know lycos's smtp host ?


Ask Lycos (or examining it from the header of an email sent from Lycos might work)


how the mail application knows each mail.smtp.host property for each provider ?


It doesn't need to - think about it, imagine the size of your application's SMTP Properties if it had to know this and be able to send emails to every domain in the world. Just find out the addres of one SMTP server and let its implementation of SMTP take care of the rest.


and if I am behind a proxy, what should I do ?


If its a simple HTTP web proxy, give up. If its a SOCKS v4 or v5 which allows anonomous connections, configure your JVM to send all TCP socket connecitons to this server (something like java -DsocksProxyHost=proxyServerName).
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic