wood burning stoves*
The moose likes Beginning Java and the fly likes Sending email from java. Pls Help!!! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Sending email from java. Pls Help!!!" Watch "Sending email from java. Pls Help!!!" New topic
Author

Sending email from java. Pls Help!!!

jonty rhodes
Greenhorn

Joined: Feb 12, 2004
Posts: 16
Hello,
I'm a newbie to Java programming. I want to write a program that will send out emails. So far, i know use Javamail, you need to download Javamail API and place it to your classpath. COuld someone please help me out with the following questions before i start programming.
1. How do i get the host name for SMTP server? ( My ISP is rogers cable in toronto)
2. i don't have outlook express setup. I want to use my hotmail account to send out emails. can i send out email from different domains: yahoo, hotmail using the hostname of SMTP server of my ISP provider?
3. If anyone's using rogers highspeed. COuld you tell me the hostname because i called them up and they told me the hostname is simply"smtp". Rogers don't have the reputation of answering questions correctly.
Any help would be greatly appreciated. THanks a lot.
James Swan
Ranch Hand

Joined: Jun 26, 2001
Posts: 403
Hi,
well I quickly looked at their website (www.rogers.com), and I am guessing the smtp hostname is "smtp.rogers.com".
You can also supply any email address (the sending email address doesn't necessarily have to be from user@rogers.com).
I am probably guessing that rogers will not let you use their mail servers as relays (meaning you will most likely have to supply your mail username/password when sending mail through their servers).
Having said this, here is some code that you can experiment with:
- fill in your username/password
- supply a from/to email address
- also, there will be a lot of debug info going to the console, it should also detail any exceptions, such as you typed your username/password wrong.

[ February 17, 2004: Message edited by: James Swan ]
Dmitry Melnik
Ranch Hand

Joined: Dec 18, 2003
Posts: 328
1. How do i get the host name for SMTP server? ( My ISP is rogers cable in toronto)
http://www.rogershelp.com/help/content/how/email/index3.shtml
Note, it requires authentication to access their SMTP server
2. i don't have outlook express setup.
You don't have to.
I want to use my hotmail account to send out emails. can i send out email from different domains: yahoo, hotmail using the hostname of SMTP server of my ISP provider?
You don't have to send your e-mail via the mail server at Rogers. Other smtp servers (like yahoo and hotmail) could be used as well.
Look for e-mail client setup instructions (pop/smtp host names, authentication policies, etc) at their sites.
In your messages you can put any e-mail address in the "From:" field, not necessarily one at the server you are using for sending this message.
3. If anyone's using rogers highspeed. COuld you tell me the hostname because i called them up and they told me the hostname is simply"smtp".
Rogers don't have the reputation of answering questions correctly.

...but so they say, and it might be true. Test it, if you don't trust them. In a console window run a command "ping smtp" and see what happens.
If you get replies, try "telnet smtp 25", and see if you'll get a SMTP server's reply string. If so, use "smtp" as your smtp server name as instructed.
Good luck
jonty rhodes
Greenhorn

Joined: Feb 12, 2004
Posts: 16
Thanks alot James and Dymitry. I'll try it..i really appreciate your quick response. Now, i can finally get to programming.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Sending email from java. Pls Help!!!