• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Help using Asprin to set up local SMTP server

 
Lance Walker
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1294
IntelliJ IDE Java Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Pie
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Lance Walker
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 757
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1294
IntelliJ IDE Java Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Treimin,

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

Marco
 
Ulf Dittmer
Rancher
Pie
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 757
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1294
IntelliJ IDE Java Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Treimin: I'm going to post an answer for you problems to the mentioned thread ;-)

Marco
 
Aggarwal Arpit
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Sheriff
Pie
Posts: 20729
30
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Follow the link that you yourself just posted. That's the page you are looking for.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic