bug-mailutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bug-mailutils] Can't send attachment and Html Body simultaneously


From: Sergey Poznyakoff
Subject: Re: [bug-mailutils] Can't send attachment and Html Body simultaneously
Date: Sat, 14 Jan 2017 14:08:38 +0200

\\/[!]shal <address@hidden> 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" address@hidden

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 \
       address@hidden < /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 - \
         address@hidden
         
> Command2:
> echo "<html><b>Hello</b></html>" | mail -s "#2" -a "content-type:
> text/html" address@hidden -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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]