aspose file tools*
The moose likes Other JSE/JEE APIs and the fly likes how to know about my mail's smtp syntax Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "how to know about my mail Watch "how to know about my mail New topic
Author

how to know about my mail's smtp syntax

Hussein Baghdadi
clojure forum advocate
Bartender

Joined: Nov 08, 2003
Posts: 3476

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 ?
Brian Pipa
Ranch Hand

Joined: Sep 29, 2003
Posts: 299
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


My Java Freeware:<br />MACCC - <a href="http://maccc.pipasoft.com" target="_blank" rel="nofollow">http://maccc.pipasoft.com</a><br />Nator - <a href="http://nator.pipasoft.com" target="_blank" rel="nofollow">http://nator.pipasoft.com</a>
eammon bannon
Ranch Hand

Joined: Mar 16, 2004
Posts: 140

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).
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to know about my mail's smtp syntax
 
Similar Threads
Java mail failing on some machine
First Problem with JavaMail, help please
Help me please, JavaMail
Help me to run my first JavaMail app
Sending mails from same domain