aspose file tools*
The moose likes Java in General and the fly likes sending email Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "sending email" Watch "sending email" New topic
Author

sending email

Raj Ohadi
Ranch Hand

Joined: Jun 30, 2006
Posts: 316
What simple JAVA API is good for sending emails ? I don't want to use any JMS or Message driven bean. The simpler the better. Please give some ideas.

Thanks
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19670
    
  18

How about JavaMail? You can find it on the Sun website.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
A Flatoff
Greenhorn

Joined: Mar 22, 2005
Posts: 12
I like Apache Commons Email.
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
Probably hijacking the thread, but what does it take to be a mail server? I'd like to send some polite non-commercial mail to a thousand or so people. I talked to my ISP about it and they were really pretty friendly about helping so I could go that route.


A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14107
    
  16

JavaMail etc. are mail client APIs, they are not useful as a mail server. For a mail server, have a look at Apache James.

But for sending mail, you don't need your own mail server. You could just use JavaMail to connect to the mail server of your ISP and send the mail via that server.
[ October 25, 2007: Message edited by: Jesper Young ]

Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
Jammy Wells
Greenhorn

Joined: Oct 04, 2007
Posts: 17
How can you connect to the mail server of your ISP?
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14107
    
  16

See this tutorial (old, from 2001, but still relevant).

Note: Don't start sending thousands of mails without talking to your ISP. They might think you are a spammer and disconnect your Internet connection.
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

Originally posted by Jammy Wells:
How can you connect to the mail server of your ISP?
And after you read the tutorial, call up the people at your ISP and ask them the technical details about connecting. Such as what's the host name and do you have to authenticate or will they configure the server so you can relay, and so on.
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
I have a Delphi client laying around that I've used before. It has some kind of leak that makes it go slower and slower over time until I have to kill it and restart. I'll look into making a Java client that does the same custom letters.

I did get some spam heat last time - complaints from receivers to my ISP - thought I don't meet the legal definition of spam. Quite.
 
 
subject: sending email