Operating System - HP-UX
1752624 Members
4212 Online
108788 Solutions
New Discussion юеВ

Re: send mail with embedded html plus .xls attachment

 
Jose Mosquera
Honored Contributor

Re: send mail with embedded html plus .xls attachment

Ok, so try this one syntax:

(echo "Subject:$SUBJECT\nTo: $MAILTO\nImportance:High\nContent-Type: text/html; charset=us-ascii\n\n$BODY";uuencode $ATTACH $ATTACH)|/usr/sbin/sendmail $MAILTO

Rgds.
Lynne Frazier
Occasional Advisor

Re: send mail with embedded html plus .xls attachment

Tried that already, it removes the .csv attachment and the email body appears as follows:

#Content-Type: text/html Content-Transfer-Encoding: 7bit Content-Type: text/html charset=us-ascii
Hello all,


Please find the February 2011 waiver codes. These waiver codes are intended for your use only and should not be forwarded to any other recipients. Thank you!

begin 644 wcode_hdr.csv M4%)!(%=A:79E
Jose Mosquera
Honored Contributor

Re: send mail with embedded html plus .xls attachment

Well, I concentrate in the case that send html code as email body...

MAILTO=someone@domain.com
SUBJECT="Test Waiver Code email"
BODY=`email.html`
HTMLFLAG="Content-type: text/html; charset=us-ascii\Content-Transfer-Encoding: 7bit\nMIME-Version: 1.0"

(echo "Subject:$SUBJECT\nTo:$MAILTO\nImportance:High\n$HTMLFLAG\n\n$BODY")|/usr/sbin/sendmail -t

Rgds.
Lynne Frazier
Occasional Advisor

Re: send mail with embedded html plus .xls attachment

Same results...As soon as I code to include any of the following statements to recognize the html & attachment, it screws up the attachment. I've tried different variations of the following:

Content-Disposition: inline
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit
MIME-Version: 1.0
Content-Disposition: attachment; filename="'$(basename wcode_hdr.csv)'"

I've been told it works on AIX using the -m flag with sendmail, but that flag is not available on HP-UX. There must be something comparable.
Lynne Frazier
Occasional Advisor

Re: send mail with embedded html plus .xls attachment

The content statements to recognize the inline html, work just fine without trying to also add a separate attachment.
Jose Mosquera
Honored Contributor

Re: send mail with embedded html plus .xls attachment

Yes, this happens because the html header forces attached file to be included as email body. If you copy the block from "begin" to "end" tags, pastes it on plain file and uudecode-it this you have the original attached file.
#man uuencode (is the same to uudecode)

You must select the most convenient way to send it, as part of email body or an attached file. We worked for it!

If you have felt assisted please do not forget assign points!

Best regards