- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: email script help needed
Categories
Company
Local Language
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
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
Community
Resources
Forums
Blogs
- 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
тАО12-12-2001 02:41 PM
тАО12-12-2001 02:41 PM
The application has the ability to send data to what it calls a printer. But all it really does is call a unix print command. I found that I can insert any unix command and it will run. So I started messing with scripts to achieve various goals.
The latest one is to take the standard output, write it to a file, then afterwards send the file as an attachment in an email.
I managed to get it to work, but not quite right. Now it is over my head. The problem is that the script sends out the email to 2 recipients. One is the one I intend the other is a default email address based on the user who invokes the script. I do not want to email going to anywhere other then the single email address that I define inside the script. The other problem is that the 'from' address is incorrect. I want to be able to define the 'from' address, so the receiver of the email can respond.
The email is generated in unix, sending output generated in a Progress application. But the reply address should not be back to the unix box, but instead a definable email address of a specific user.
I am including the script for you all to look at, and give any suggestions.
Thanks.
I hope this is clear as mud. ..
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-12-2001 03:04 PM
тАО12-12-2001 03:04 PM
SolutionOne way is to use sendmail directly. Here's how: Suppose you want to send a file named "TEST" to troy@domain.com and troy@foo.com as if coming from mysteryuser@foo.com. You can do something like that:
temp=/tmp/mail.$$
echo "From: mysteryuser@foo.com" >>$temp
echo "To: troy@domain.com, troy@foo.com" >>$temp
echo "Subject: This is the subject" >>$temp
echo "" >>$temp
cat $temp TEST | /usr/sbin/sendmail -t
rm -f $temp
You can even do it without intermediate files. All you need are your standard RFC822 headers (From, To, Subject) and a blank line before the mail itself. Sendmail will do the rest for you. Also note that this will only work if the sending user is a 'trusted' user (see /etc/sendmail.cf).
Hope it helps,
Paga
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-12-2001 04:32 PM
тАО12-12-2001 04:32 PM
Re: email script help needed
This is a perfect example of why I always look for help here! It is fast and efficient.
The suggestion worked perfectly. We just added email ability to our old clunky application - no need for the expensive upgrade now!
ha ha.
Thanks. This solution is exactly what I needed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-28-2001 01:28 PM
тАО12-28-2001 01:28 PM
Re: email script help needed
Thanks,
Joe Gilligan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-28-2001 01:41 PM
тАО12-28-2001 01:41 PM
Re: email script help needed
We are using Trend, which is now called Nxtrend.
It is a wholesale warehousing application designed to handle inventory and sales.
Troy