jQuery in Action, 3rd edition
The moose likes Tomcat and the fly likes Set FROM in context.xml Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Building Microservices this week in the Design forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Set FROM in context.xml " Watch "Set FROM in context.xml " New topic

Set FROM in context.xml

Imre Tokai
Ranch Hand

Joined: Jun 04, 2008
Posts: 130

My context.xml looks like:

I want to put FROM also in this Context. For now it's hard-coded:

I'm picking values with:

How can i set the FROM value with contex.xml?

Rene Larsen
Ranch Hand

Joined: Oct 12, 2001
Posts: 1179

I think you can use the "mail.smtp.from" property.

You can read more about which properties you can set here: JavaMail: Package com.sun.mail.smtp Description

Regards, Rene Larsen
Dropbox Invite
Imre Tokai
Ranch Hand

Joined: Jun 04, 2008
Posts: 130
Thank You for the answer, Rene!

When I set mail.smtp.from="from@email.com" the mail is sent, and the FROM is set to: username@mycomputername and not to the from@email.com

Any more hints?

I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
subject: Set FROM in context.xml
It's not a secret anymore!