wood burning stoves 2.0
The moose likes Other JSE/JEE APIs and the fly likes configuring JavaMail with Sendmail Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "configuring JavaMail with Sendmail" Watch "configuring JavaMail with Sendmail" New topic

configuring JavaMail with Sendmail

Alan Shiers
Ranch Hand

Joined: Sep 24, 2003
Posts: 237
Hi there,

I create a simple standalone app that has the following method in it for sending emails:

This method works perfectly if the SMTPServerName is set for my ISP's smtp server. But since I have my own in-house server now which is running Linux, I thought to try and make use of its Sendmail server instead.

So, I need to know what I need to change in my method, if anything, in order to send out emails through Sendmail. For starters, I consulted a book I have on linux which explains how to configure Sendmail as a relay to send messages out. I made those changes and restarted Sendmail. So that end is set.

Since the server is part of my LAN on IP address:, In my client app (on a different Windows computer withing the LAN), I tried setting the SMTPServerName to the IP address of my server running Sendmail. Then proceeded to send myself an email. That didn't work. I know Sendmail is listening on port 25 so I tried adding the port number, but that didn't work.

So, what is SMTPServerName supposed to be if I'm trying to connect to Sendmail to send out an email?

Is the method adequate for what I need it to do, or do I have to change it?

Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42965
That didn't work.

but that didn't work.

What do either of those remarks mean? What happened when you tried? Were there any error messages in the sendmail logs?
I agree. Here's the link: http://aspose.com/file-tools
subject: configuring JavaMail with Sendmail
It's not a secret anymore!