- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Re: sending mail thru a jsp
Operating System - Linux
1753747
Members
5162
Online
108799
Solutions
Forums
Categories
Company
Local Language
юдл
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
юдл
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-04-2004 03:22 AM
тАО06-04-2004 03:22 AM
sending mail thru a jsp
I am trying to send mail using sendmail on linux redhat 9.0 on a jsp page. i am executing from Runtime calss' exec(string),
where the string is
String string[]={"/bin/sh","-c","sendmail rec@hisadd.com"," thte commend worked fine on command line but not working thru' jsp, any problem in my approach.
where the string is
String string[]={"/bin/sh","-c","sendmail rec@hisadd.com","
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-04-2004 03:47 AM
тАО06-04-2004 03:47 AM
Re: sending mail thru a jsp
check dns setup
nslookup hisadd.com
If you get an answer sendmail should send.
mailq
See if your message is being queued but not delievered
sendmail -q -v
see the error.
Respond to the error.
Make sure sendmail is not got a DS directive in sendmail.cf
You do not want to try relaying mail off your isp' smtp server unless they allow that.
You might need to check with your isp. Some are thinking about blocking outbound port 25 traffic to keep their customers from sending spam.
SEP
nslookup hisadd.com
If you get an answer sendmail should send.
mailq
See if your message is being queued but not delievered
sendmail -q -v
see the error.
Respond to the error.
Make sure sendmail is not got a DS directive in sendmail.cf
You do not want to try relaying mail off your isp' smtp server unless they allow that.
You might need to check with your isp. Some are thinking about blocking outbound port 25 traffic to keep their customers from sending spam.
SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-06-2004 11:37 AM
тАО06-06-2004 11:37 AM
Re: sending mail thru a jsp
What error are you getting when that is exec'd?
Three possible errors I can see are these:
Path in an exec environment probably doesn't have either '/usr/sbin' or '/usr/lib' thus 'sendmail' on it's own (not path'd) won't work.
The '< messagefile' requires that 'messagefile' be in the current-working-directory. Unless you can gaurantee that the CWD has 'messagefile', use the full path to it.
Given the manner in which you're populating the String, I'd assume that each individual argument is supposed to be on it's own. You're stacking 'sendmail' and 'rec@hisadd.com' on top of each other. Try separating these as well.
So in summary, try this:
String string[]={"/bin/sh", "-c", "/usr/lib/sendmail", "rec@hisadd.com", "< /full/path/to/messagefile"};
Three possible errors I can see are these:
Path in an exec environment probably doesn't have either '/usr/sbin' or '/usr/lib' thus 'sendmail' on it's own (not path'd) won't work.
The '< messagefile' requires that 'messagefile' be in the current-working-directory. Unless you can gaurantee that the CWD has 'messagefile', use the full path to it.
Given the manner in which you're populating the String, I'd assume that each individual argument is supposed to be on it's own. You're stacking 'sendmail' and 'rec@hisadd.com' on top of each other. Try separating these as well.
So in summary, try this:
String string[]={"/bin/sh", "-c", "/usr/lib/sendmail", "rec@hisadd.com", "< /full/path/to/messagefile"};
One long-haired git at your service...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-06-2004 08:37 PM
тАО06-06-2004 08:37 PM
Re: sending mail thru a jsp
Try the jsp attached, it uses javamail class, it works fine in my host.
It is better than your approach using sendmail.
just substitute smtp.telepac.pt with yours smtp host.
Joao Mendes
Portugal
It is better than your approach using sendmail.
just substitute smtp.telepac.pt with yours smtp host.
Joao Mendes
Portugal
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
News and Events
Support
© Copyright 2024 Hewlett Packard Enterprise Development LP