- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Script to send HTML email
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
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
тАО01-17-2006 07:45 AM
тАО01-17-2006 07:45 AM
What I wanted to do is send the emails like an html document so I could add some color to it so they might know how fast they need to look at it.
Using shell script to create a HTML attachment is easy.
What I do not know is how code it so when I send it and the uses opens the email it is a html document.
After searching the web I find a lot of package that do this. I don't want to any thing fancy. Besides I have fun writing little scrpts that do neat things.
Normally I just use "mail -s "Alert Message" userID What would be needed if this message was HTML.
Marty
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-17-2006 07:49 AM
тАО01-17-2006 07:49 AM
Re: Script to send HTML email
You can try using uuencode with it, but I don't belive it would be needed.
mark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-17-2006 07:59 AM
тАО01-17-2006 07:59 AM
Re: Script to send HTML email
I am sending the file like this. (Typo above)
mailx -s "test html message marty"
There has to be a way to tag the html file taht is an html so the client software will display it.
I use outlook and it open other html emails but I do not see how it knows to do so.
Marty
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-17-2006 08:17 AM
тАО01-17-2006 08:17 AM
Re: Script to send HTML email
instead of html formatted you can use the command "banner" to generate your message-file. i don't know whether it helps you.
Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-17-2006 08:23 AM
тАО01-17-2006 08:23 AM
Re: Script to send HTML email
I do that now with some of the messages.
I thought the might be an easy to send a hrml file the would open right up without being an attachment.
I just wanted to try to get a little fancy.
Marty
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-17-2006 08:25 AM
тАО01-17-2006 08:25 AM
Re: Script to send HTML email
We have many jobs that do this, sending the HTML as an attachment to a user on Outlook from our 11.0 machines.
This is the mailx command used -
uuencode ${OUTPUT_FILE} "Netbackup Daily Report_${Yesterday}.html" | $MAIL -s "Netbackup Nightly Jobs Report For ${YDATE}" ${ADDRESS}
If the variables are not clear to you I can give the same example with the actual values but OUTPUT_FILE=the unix html file, YDATE is a formated date for yesterday as is Yesterday [different formats], ADDRESS is the recipient email address.
Best of luck.
Regards,
dl
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-17-2006 08:37 AM
тАО01-17-2006 08:37 AM
Re: Script to send HTML email
I prefer attachements.
Download and install mpack:
http://hpux.ee.ualberta.ca/hppd/hpux/Users/mpack-1.6/
Run like so:
/usr/local/bin/mpack -s "svr004 cfg2html" /opt/cfg2html/svr004.html gwild@mydomian.ca
Rgds...Geoff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-17-2006 08:45 AM
тАО01-17-2006 08:45 AM
Re: Script to send HTML email
I guess what I want is an embedded html email.
Marty
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-18-2006 01:43 AM
тАО01-18-2006 01:43 AM
Re: Script to send HTML email
I did find this via google - that may help:
http://willmaster.com/possibilities/archives/wmp20020716001.shtml
There is an example cgi script...look at the "sub SendEmail" section...
Rgds...Geoff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-18-2006 02:18 AM
тАО01-18-2006 02:18 AM
Re: Script to send HTML email
http://caspian.dotconf.net/menu/Software/SendEmail/
It is quite a large script...
To send html embeded:
cat /path/to/somefile.html | sendEmail.pl -f from@email.address -t to@email.address -u "Your Subject"
The html file must start with
If sendmail isn't running as a daemon on the localhost, then modify the line in the script from localhost to your email server:
"server" => 'localhost', ## Default SMTP server
Rgds..Geoff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-18-2006 03:02 AM
тАО01-18-2006 03:02 AM
Solutiona bit late, but maybe ...
mail should start with
To: auser@mycompany.com
CC: anotheruser
Subject: report
Content-Type: text/html
<- a blank line
...
then pipe to /usr/lib/sendmail -t
I didn't details sending file as attachement as you find it too easy ;-)
Jean-Yves
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-18-2006 03:32 AM
тАО01-18-2006 03:32 AM
Re: Script to send HTML email
It is easy after all.
I just add "Content-Type: text/html"
and a blank line to the top if the a HTML file and send it.
It is more involved with links and graphics but I am not planning any of that.
Thanks again.
Marty
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-18-2006 06:23 AM
тАО01-18-2006 06:23 AM
Re: Script to send HTML email
echo "To: you@yourdomain.com\nSubject: your subject\nContent-Type: text/html\n\n"`cat /path/to/somefile.html` | sendmail -t
Works like a charm :)
Rgds...Geoff