This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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 Murach's Java Servlets and JSP this week in the Servlets 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="" the mail is sent, and the FROM is set to: username@mycomputername and not to the

Any more hints?

I agree. Here's the link:
subject: Set FROM in context.xml
Similar Threads
JavaMail w/ Tomat problem
Accessing implicit Objects in JSP
integrate mail server to J2ee application
Tomcat/Javamail Question
Tomcat 5.5 and context.xml