Re: Can't send attachment and Html Body simultaneously

Sergey Poznyakoff <[email protected]>
Newsgroups gmane.comp.gnu.mailutils.bugs
Organization GNU.org.ua
Message-ID <[email protected]>
\\/[!]shal <[email protected]> ha escrit:

> I can not send email with html body with attachment.
> echo "<html><b>Hello</b></html>" | mail -s "#1" -a "content-type:
> text/html" [email protected]

That's wrong.  This command does not create an attachment at all, it
simply puts the supplied text in the body of the message. 

If you wish to send that text as attachment, first save it to a
temporary file, and then attach it using the -A option:

  echo "<html><b>Hello</b></html>" > 1.tmp
  mail -s "#1" --content-type text/html -A 1.tmp \
       [email protected] < /dev/null
  rm 1.tmp

Note that the recent changes (commits eabddf8 to 63229086) make it
possible to avoid creation of the temporary.  Using git HEAD, you can do
that in one line as follows:
  
  echo "<html><b>Hello</b></html>" | \
    mail -s "#1" --content-type text/html -A - \
         [email protected]
	 
> Command2:
> echo "<html><b>Hello</b></html>" | mail -s "#2" -a "content-type:
> text/html" [email protected] -A "/Users/vishal/Downloads/00000001.pdf"
> Command1 works fine. I see email with html body, but in 2nd command body is
> in text format.

I don't quite get what you mean by "command body".  What's the intent of
Command2?

Regards,
Sergey
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.