• 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
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

Sending email from java. Pls Help!!!

 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 403
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
 
Ranch Hand
Posts: 328
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks alot James and Dymitry. I'll try it..i really appreciate your quick response. Now, i can finally get to programming.
 
His brain is the size of a cherry pit! About the size of this ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic