Question: Email html file as an attachment on AIX using sendmail

Question: Email html file as an attachment on AIX using sendmail

Post by Suha » Sat, 14 Feb 2004 00:35:52



Hello Everyone,

I am trying to email a html file as an attachment using sendmail. It
works when I send it to my yahoo or att account, however I don't get
an email when I send it to my hotmail account. Yes, the "from" address
is on my hotmail "safe-list" & I have tried sending just a plain email
to hotmail and it works.

Here is my script: I have borrowed it from one of the postings on this
group.

### Begin script


FILENAME=test.html



echo "To: $RECEIVER" >> mailfile
echo "Subject: TEST" >> mailfile
echo "MIME-Version: 1.0" >> mailfile
echo "Content-Type: multipart/mixed; boundary=\"SGT-boundary-line\""

Quote:>> mailfile

echo "X-MS-Has-Attach: yes" >> mailfile
echo "X-Mailer: AIX" >> mailfile
echo "X-Credit: ZZZ" >> mailfile
echo "\n" >> mailfile

echo "\n--SGT-boundary-line" > workfile
echo "Content-Type: text/html;" >> workfile
echo "        name=\"$FILENAME\"" >> workfile
echo "Content-Transfer-Encoding: 7bit" >> workfile
echo "Content-Disposition: attachment;" >> workfile
echo "        filename=\"$FILENAME\"\n" >> workfile

cat $FILENAME >> workfile

echo "\n--SGT-boundary-line--\n" >> workfile

cat workfile >> mailfile

/usr/lib/sendmail -t $RECEIVER < mailfile

### End of script

For some reason, this does not work for hotmail. Can someone shed some
light & point me in the right direction?

Thanks,
Suhas

 
 
 

Question: Email html file as an attachment on AIX using sendmail

Post by William Par » Sat, 14 Feb 2004 04:06:57



> echo "\n" >> mailfile

> echo "\n--SGT-boundary-line" > workfile
> echo "        filename=\"$FILENAME\"\n" >> workfile
> echo "\n--SGT-boundary-line--\n" >> workfile

Hint:  Note the difference between
    echo "\n"
    echo -e "\n"

--

Linux solution for data management and processing.

 
 
 

Question: Email html file as an attachment on AIX using sendmail

Post by Michael Heimin » Sat, 14 Feb 2004 05:01:26


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

[..]

Quote:> > echo "\n--SGT-boundary-line--\n" >> workfile
> Hint:  Note the difference between
>     echo "\n"
>     echo -e "\n"

Likely, the script was made on some *nix[tm] and won't run on a
Linux box with adding "-e".

However, what about 'man uuencode'.
;)

- --
Michael Heiming (GPG-Key ID: 0xEDD27B94)

Remove +SIGNS and www. if you expect an answer, sorry for
inconvenience, but I get tons of spam.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQFAK9uUAkPEju3Se5QRAh4YAJ4k7KmKoaRUhYD59EXZNwsOiHavmgCgiHM5
mSVtAjDRhXbS27ahiIQvHtY=
=UUbL
-----END PGP SIGNATURE-----

 
 
 

Question: Email html file as an attachment on AIX using sendmail

Post by Suha » Sat, 14 Feb 2004 22:34:21




> > echo "\n" >> mailfile

> > echo "\n--SGT-boundary-line" > workfile

> > echo "        filename=\"$FILENAME\"\n" >> workfile

> > echo "\n--SGT-boundary-line--\n" >> workfile

> Hint:  Note the difference between
>     echo "\n"
>     echo -e "\n"

I am running this script on an AIX box. Not quite sure what the -e
option does or will do. It's not in the man pages.

Thanks,
Suhas

 
 
 

Question: Email html file as an attachment on AIX using sendmail

Post by Carlos J. G. Duart » Sun, 15 Feb 2004 04:25:35



> For some reason, this does not work for hotmail. Can someone shed some
> light & point me in the right direction?

does it work for other emails? If so try to replace the \n with \r\n . I
think sendmail does that, but you can try it anyway:

$ sed 's/$/'"$(echo x | tr x \\015 )"'/' mailfile | sendmail -t from

--
carlos ** http://cgd.sdf-eu.org

 
 
 

1. HTML attachment using sendmail

Hello Everyone,

I am having problems sending an HTML file as an attachment using
sendmail. Maybe someone has a solution.

For sending the HTML file as an attachment & for it to work for all
the internet based email domains (eg: hotmail, yahoo, att, etc) and
not just Outlook or Outlook Express, I am inserting MIME headers at
the top of the HTML file as:



Subject: Bug Fix
Date: 01 Mar 2004 10:46:07 CST

MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="MAIL_BOUNDARY";
Content-Transfer-Encoding: 7bit

--MAIL_BOUNDARY
Content-Type: text/html; charset="US-ASCII"
Content-Transfer-Encoding: 7bit

--MAIL_BOUNDARY
Content-Type: application/html; name="bugfix.html";
Content-Disposition: attachment; filename="bugfix.html";

<HTML><HEAD>
<TITLE>HTMLGen TEST</TITLE>
.
.
.
.
.
.
</BODY>
</HTML>

--MAIL_BOUNDARY--

I then use the sendmail command as:

This works fine (ie. I get the HTML file as an attachment in Outlook,
hotmail, yahoo, etc) as long as the number of characters in each line
of the HTML file does not exceed 991 characters (not quite sure about
it's significance). However, if it exceeds 991 characters, it starts
printing junk for char 992 onwards such as: !nb& &n! etc.

If I remove the MIME headers & use sendmail to send the HTML file, it
comes in as an attachment & looks fine in Outlook or Outlook Express.
However, it does not come in as an attachment (I see the actual HTML
tags in the body of the message) in hotmail, yahoo, etc.

I am not quite sure if it is sendmail that is creating problems or if
the MIME header info. is not correct.

Can someone shed some light?

Thanks,
Suhas

2. kppp intermittent problem HELP!!!

3. how to email file as html attachment

4. X Newsreader for uucp news

5. virus scanner email attachments for aix

6. 2.4.20-pre sundance.c update

7. How to send an email with attachment using the command line

8. Has anyone installed EWS successfully

9. attached file to e-mail using mailx in AIX

10. Solaris Email Attachment Question

11. I need to send a email with a text file attachment.

12. wanted: e-mail pkg. that allows file attachments Sunsparc2000 Sol.2.x

13. e-mail with file attachments