- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- HTML + attachment in the same mail
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
Forums
Discussions
Discussions
Discussions
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
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
10-23-2006 01:51 AM
10-23-2006 01:51 AM
HTML + attachment in the same mail
I am working on UNIX (Solaris28). I would like to send an email in which the body will be in html format and a file will be attached.
I have tried this but the body comes as html source and not formatted.
cat /tmp/mail.html ; uuencode file.xls file.xls ) | /usr/lib/sendmail -t "myname@mydomain.com"
The mail.html file conatins the following text:
From: myname2@mydomain.com
Content-Type: text/html
Content-Transfer-Encoding: 7bit
This is my first homepage. This text is bold
Any help would be greatly appreciated.
Stefan.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-23-2006 02:08 AM
10-23-2006 02:08 AM
Re: HTML + attachment in the same mail
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=202647&admit=-682735245+1161612452958+28353475
Rgds...Geoff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-23-2006 06:00 AM
10-23-2006 06:00 AM
Re: HTML + attachment in the same mail
I tried the script but always the same results. The attachement is linked well but the body is the html source and not the html formatted like I would like to have it.
Any other suggestions from anyone ?
Thank you in advance.
Dejan.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-23-2006 06:32 AM
10-23-2006 06:32 AM
Re: HTML + attachment in the same mail
See Frank's response in this thread:
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=202647
He passes MIME headers, including Content-Type, directly to sendmail.
PCS
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-23-2006 08:42 AM
10-23-2006 08:42 AM
Re: HTML + attachment in the same mail
I don't think the attachment can be in the body of the email.
If you use this script for the attachment:
http://www.hpux.ws/mailfile2
I think you can easily adapt it to handle the html requirement.
The script is production. Please change the default email address or someone I used to work with is going to be annoyed.
SEP
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
10-24-2006 04:20 AM
10-24-2006 04:20 AM
Re: HTML + attachment in the same mail
Well I have stayed away from this since it has been answered so many times in the past.
Attached you will find many examples of using mailx including the attachment.
in your case the command would look somewhat like this -
uuencode YOUR_FILE "YOUR_FILE.htm" | mailx -s "Some Subject" someone@somewhere.com
Note that the attached is our shop's in house doc and not endorsed outside of our business.
Regards,
-dl
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-24-2006 04:21 AM
10-24-2006 04:21 AM
Re: HTML + attachment in the same mail
Sorry but noone of the 2 solutions works correctly (or maybe i misundertand you).
Spex, with your solution, I do not see anywhere where to put my html source an to see it formatted in my e-mail. I tried to replace the line echo "DMS file attached" >> $fmesg with my html source but what i see in my email is the source code and not what I want.
Steven,
with your solution I see correctly the html text formatted but the attachment is not attachment but directly in the body of the message.
If you have a complete example please describe me in details what are the steps to do and what i have forgotten
So, maybe I was not clear enough so I try to re-ask my question:
I want to have both an attchment linked to my e-mail and html text (not the source but the formatted text).
In other words, The body of the message have to appear in bold, blue, underlined and an attachment should be linked.
I know that:
1/ cat /tmp/mail.html | /usr/lib/sendmail -t "myname@mydomain.com" gives me the correct html format in the body
2/ uuencode file.xls file.xls | /usr/lib/sendmail -t "myname@mydomain.com"
gives me an attchment in my mail
BUT... i am not able to merge both results (it looks like if there is a attachment the body is always giving me the html source code)
Please help to solve that issue...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-24-2006 04:25 AM
10-24-2006 04:25 AM
Re: HTML + attachment in the same mail
Your suggestion produces a message with an HTML file attachment. Stefan is looking for inline HTML, which is embedded in the message body. The only way I know of doing is this setting the Content-Type MIME header to text/html.
PCS
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-24-2006 04:36 AM
10-24-2006 04:36 AM
Re: HTML + attachment in the same mail
Your suggestions is sending html in an attachment and it is not what I want.
OK, so with Dave's reply I can see that MY question was not clear :(.
Hope my previous mail is clearer ;)
Stefan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-24-2006 05:39 AM
10-24-2006 05:39 AM
Re: HTML + attachment in the same mail
I just tested this with Outlook, and and the HTML is rendered without a problem. Here's a step-by-step:
1) Save the attachment to this posting as domail.sh (courtesy of Frank Slootweg).
2) Transfer domail.sh to your server.
3) # chmod +x domail.sh
4) # echo "Test message" > body.html
5) ./domail.sh "subject_line" your@email.addr < body.html
As I mentioned in my last posting, the answer is in this thread:
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=202647
PCS
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-24-2006 08:24 PM
10-24-2006 08:24 PM
Re: HTML + attachment in the same mail
Thank you agin for your reply. I agree that your answer is correctly giving me the correct html in the body of my mail... BUT what about the file attachment I want to link to my e-mail ?
In your steps, I can not see anything refering to an attached file i would like to link ...
Regards.
Stefan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-26-2006 02:32 AM
10-26-2006 02:32 AM
Re: HTML + attachment in the same mail
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-26-2006 02:59 AM
10-26-2006 02:59 AM
Re: HTML + attachment in the same mail
In other words, The body of the message have to appear in bold, blue, underlined and an attachment should be linked.
I know that:
1/ cat /tmp/mail.html | /usr/lib/sendmail -t "myname@mydomain.com" gives me the correct html format in the body
2/ uuencode file.xls file.xls | /usr/lib/sendmail -t "myname@mydomain.com"
gives me an attchment in my mail
This implies that you can, instead do:
1) uuencode file.xls file.xls > /tmp/attached.file
2) cat /tmp/mail.htlm /tmp/attached.file | /usr/lib/sendmail -t ......
give that a try and see how it goes.....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-26-2006 08:15 AM
10-26-2006 08:15 AM
Re: HTML + attachment in the same mail
I tested this w/ Lotus Notes, result is the body displays the html doc and it has the xls sheet as an attachment, which is I believe what you want.
echo 'MIME-Version: 1.0' > somefile.out
echo 'Content-Type: multipart/mixed; boundary="abcdefgabcdefg"' >> somefile.out
echo '--abcdefgabcdefg' >> somefile.out
echo 'Content-Type: text/html; charset=us-ascii' >> somefile.out
cat your.html >> somefile.out
echo '--abcdefgabcdefg' >> somefile.out
uuencode some.xls some.xls > somefile.out
cat somefile.out | sendmail -t your.name@yourmail.com