This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Other JSE/JEE APIs and the fly likes Help using Asprin to set up local SMTP server Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "Help using Asprin to set up local SMTP server" Watch "Help using Asprin to set up local SMTP server" New topic
Author

Help using Asprin to set up local SMTP server

Lance Walker
Greenhorn

Joined: Mar 09, 2009
Posts: 23
Hi I'm trying to find a java solution which will allow me to set up the local host into a a VERY light SMTP server. Essentially, I just need to send a single message from the local host which contains configuration details, and I really don't want to mess around which SMTP authentication and such (Trying to keep this as simple as possible, as its a very insignificant [though essential] part of my program). I've have been looking at a variety of tools and I found Asprin, which is an embeddable SMTP server. However, it provides little documentation, and I was wondering if anyone who has had experience using it could provide some insight on how you can set up the server and send messages.
It seems pretty simple to use, but I am also new to the JavaMail API so tackling both at the same time has proved to be harder than I thought.
The project is located here:
https://aspirin.dev.java.net/
Thanks in advance for any help.
Marco Ehrentreich
best scout
Bartender

Joined: Mar 07, 2007
Posts: 1280

Hi Lance,

actually I haven't tested it myself. But did you read the point "How do I use it?" on the new Aspirin home page? It sounds really pretty easy to send a simple mail with Aspirin.

And from what I see you don't need to know very much about JavaMail for this. You just have to set the necessary fields in the MimeMessage you can create accordingly to the Aspirin documentation almost like you would do when typing a mail in your favorite mail client (recipient, content, ...) ;-) Give it a try and feel free to let me know where you experience problems!

Marco
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41173
    
  45
Yeah, I've successfully used aspirin. Here's about the simplest possible code to send a mail with it. You'll have to add assorted import statement for the JavaMail and aspirin classes.

Very important: you need to set a system property called "aspirinDeliverThreads" to "1". Otherwise it starts more than one mail sender thread, and that will lead to problems at shutdown time.


Ping & DNS - my free Android networking tools app
Lance Walker
Greenhorn

Joined: Mar 09, 2009
Posts: 23
Thanks so much for your help, works great. I guess that I just didn't know enough about JavaMail rather than asprin .
Treimin Clark
Ranch Hand

Joined: Nov 12, 2008
Posts: 757
Ulf Dittmer wrote:Yeah, I've successfully used aspirin.

Hay Ulf, I'm in jealous of your success.
As I could never use Aspirin.
Marco Ehrentreich
best scout
Bartender

Joined: Mar 07, 2007
Posts: 1280

Hi Treimin,

are you still having problems to send mails as described in the other post?

Marco
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41173
    
  45
could never use Aspirin

As I pointed out elsewhere, that had nothing to do with aspirin, but is the result of a certain combination of sender address and recipient address. Any other mail server would have encountered the same problem.

But let's not hijack this thread any further by posts that have nothing to do with Lance's problem.
Treimin Clark
Ranch Hand

Joined: Nov 12, 2008
Posts: 757
Marco,

Yes, I can never do that on my machine, with my current ISP.


Ulf,

I know that, you told it me before. The problem may be with my ISP. Sorry for attempting to hijack the thread
Marco Ehrentreich
best scout
Bartender

Joined: Mar 07, 2007
Posts: 1280

Treimin: I'm going to post an answer for you problems to the mentioned thread ;-)

Marco
Aggarwal Arpit
Ranch Hand

Joined: Mar 04, 2012
Posts: 86
Hi Ulf,

I downloaded zipped file of Aspirin from https://github.com/masukomi/aspirin. But not getting how to use it.
Can you please throw some light on how to work with Aspirin.

Thanks in Advance
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

Follow the link that you yourself just posted. That's the page you are looking for.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Help using Asprin to set up local SMTP server
 
Similar Threads
SocketException with JavaMail
smtp host in java mail program
Aspirin Cannot Send Mails
Java Mail SMTP host ??
sending email in servlet