Operating System - HP-UX
1826614 Members
2766 Online
109695 Solutions
New Discussion

Re: Mailing html file from HPUX to outlook

 
SOLVED
Go to solution
vtpaulson
Frequent Advisor

Mailing html file from HPUX to outlook

Hi,

I want to send a html file from HPUX to outlook. I use the following command

ux2dos test.html | uuencode test.html | mailx -m -s "test" mail@mail.com

I get the html file as attachment, but I would like to receive that as html message instead of attachment.

Anybody can help me?

Thanks in advance.
15 REPLIES 15
Ravi_8
Honored Contributor

Re: Mailing html file from HPUX to outlook

Hi,
html files always an attachment.
never give up
Gavin Clarke
Trusted Contributor

Re: Mailing html file from HPUX to outlook

Spooky I was going to ask a similar question about sending html from HPUX (I only want it to go as an attachment though). Thanks for the answer, I will give it a try.
Pete Ellis
Trusted Contributor

Re: Mailing html file from HPUX to outlook

Have you tried:

cat test.html | mail mail@mail.com

or

mail <Subject:test
`cat /usr/btmis/www/docs/hp/backup/backup.sys.html`
.
eof

Shannon Petry
Honored Contributor

Re: Mailing html file from HPUX to outlook

HTML files are not always an attachment. The "uuencode" feature is making the html file into an attachment.

Mail the file to yourself, and skil the uuencode part.

All better



Regards,
Shannon
Microsoft. When do you want a virus today?
Steven E. Protter
Exalted Contributor

Re: Mailing html file from HPUX to outlook

Try this script. It can easily be adapted to build or attach an html file.

It uses ascii.

I've found uuencode does strange things to files.

You always need to be aware of your mail relay server isn't patched properly it can chop up or even reject valid attachments.

The attached script is production and is therefore fully tested.

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
Dave La Mar
Honored Contributor

Re: Mailing html file from HPUX to outlook

Just tried what you are asking.
In the body will be the html format text, not an html report.
I believe this was stated in one of the replies.
I am only confirming.

Regards,
dl
"I'm not dumb. I just have a command of thoroughly useless information."
vtpaulson
Frequent Advisor

Re: Mailing html file from HPUX to outlook

Thanks everybody for the reply. Unfortunately none of them helped me!!.

FYI, this attchment is created mainly because of -m option in mailx. If I change this syntax in anyway it will just display html source code in my outlook. Otherwise sends as attachment.

I am wondering how omnirpt sends a mail. If any of you know, omirpt sends html directly to outlook. If I see the source code it is no different from the one I am sending from my UX box. Still couldn't figure out why I am seeing the source code instead of the html report.

Lets see if anyone has better idea.
Frank Slootweg
Honored Contributor

Re: Mailing html file from HPUX to outlook

The problem is that mailx(1) does not understand MIME (Multi-purpose Internet Mail Extensions), i.e. it will not include lines like:

MIME-Version: 1.0
Content-Type: text/html; charset=us-ascii

etc..

I do not know if elm(1) will handle MIME. If not, it is probably best to call sendmail(1M) directly, like Steven does in his script, and add the required header lines.
vtpaulson
Frequent Advisor

Re: Mailing html file from HPUX to outlook

Hi Frank,

I did tried sendmail option as suggested by Steven. It works exactly same as my command except that it adds a short message column.

Paulson
Frank Slootweg
Honored Contributor

Re: Mailing html file from HPUX to outlook

You should not only use sendmail, but *also* the "MIME-Version: 1.0" and "Content-type: ..." lines I mentioned. In Steven's script he uses *similar*, but not the *same* lines, but they are commented out.
Frank Slootweg
Honored Contributor
Solution

Re: Mailing html file from HPUX to outlook

I have attached a *very minimal* (i.e. no error checking; parameters *must* be present and in the given order; etc.) script which shows what I mean. Use as:

cat html_file | domail "some subject" user@domain
Chris Vail
Honored Contributor

Re: Mailing html file from HPUX to outlook

Instead of mailx, try mutt, from www.mutt.org. This Mail User Agent is described as "all mail agents suck, this one sucks slightly less". This one allows you to attach your document as a MIME compliant document from the comand line, and recognizes HTML code. We use it here instead of setting up print services. Its called 'mutt' because it is a 'mongrel' email client--combines email and news in a single tool.
Another thing to check is txt2pdf. This will convert your html file to a .pdf file, which is fairly invulnerable to Mail Transport Agents, virus checkers and other things which tend to munge email. You can get a freeware version from http://www.sanface.com/txt2pdf.html.

Check 'em out.
Chris
vtpaulson
Frequent Advisor

Re: Mailing html file from HPUX to outlook

Thanks Frank. Your command worked perfectly. Really appreciate your help. Thanks everybody for your suggestions.

Paulson.
Jeff Schussele
Honored Contributor

Re: Mailing html file from HPUX to outlook

A fat hare for the Slootinator.......
Fun isn't it Frank?

Well Done,
Jeff (we DO appreciate it)
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Frank Slootweg
Honored Contributor

Re: Mailing html file from HPUX to outlook

[Had to lookup "hare".]

Yes, it is fun. It is especially fun when one's efforts are appreciated. If that appreciation is topped off with points, it's even greater.

"the Slootinator"! I have to remember that one. Better not tell what "sloot" or "weg" means. I would spoil the image! :-)

[No points (0 or N/A) for this response please.]