How Can SENDMAIL Create Messages with Plain Text and HTML

  • This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.
Jun 2, 2008
284
1
Newton, MA
#1
I figured out -- and just now noticed that Rex has it in the help --
that HTML-format messages can be sent by including the option

/h"Content-Type: text/html"

I have not been able to figure out how to send multipart messages, i.e.,
messages with both plain-text and HTML versions. By looking at the
source for such messages that I have received, I see more complex header
commands with parts of the message body interspersed, as in the
simplified example at the end of this message (I hope that text does not
mess up the posting).

Does anyone know how to create such a message using the SENDMAIL command?

-- Jay

Content-Type: multipart/alternative;
boundary="----=_Part_8090794_20773066.1256141590831"
X-Antivirus: avast! (VPS 091020-0, 10/20/2009), Inbound message
X-Antivirus-Status: Clean

------=_Part_8090794_20773066.1256141590831
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

PLAIN TEXT VERSION

------=_Part_8090794_20773066.1256141590831
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

HTML VERSION

------=_Part_8090794_20773066.1256141590831--
 

samintz

Scott Mintz
May 20, 2008
1,204
11
Solon, OH, USA
#2
How Can SENDMAIL Be Used to Create Messages with Plain Text and HTML

I have not personally tried it, but have you tried using /H"Content-Type:
multipart/alternative" and then including the rest as the body of the
message?

E.g. your message would need to contain:
boundary="some special boundary text"

some special boundary text
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

PLAIN TEXT VERSION

some special boundary text
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

HTML VERSION


-Scott


Jay Sage <> wrote on 10/26/2009 05:05:24 PM:


> I figured out -- and just now noticed that Rex has it in the help --
> that HTML-format messages can be sent by including the option
>
> /h"Content-Type: text/html"
>
> I have not been able to figure out how to send multipart messages, i.e.,

> messages with both plain-text and HTML versions. By looking at the
> source for such messages that I have received, I see more complex header

> commands with parts of the message body interspersed, as in the
> simplified example at the end of this message (I hope that text does not

> mess up the posting).
>
> Does anyone know how to create such a message using the SENDMAIL
command?

>
> -- Jay
>
> Content-Type: multipart/alternative;
> boundary="----=_Part_8090794_20773066.1256141590831"
> X-Antivirus: avast! (VPS 091020-0, 10/20/2009), Inbound message
> X-Antivirus-Status: Clean
>
> ------=_Part_8090794_20773066.1256141590831
> Content-Type: text/plain; charset=us-ascii
> Content-Transfer-Encoding: 7bit
>
> PLAIN TEXT VERSION
>
> ------=_Part_8090794_20773066.1256141590831
> Content-Type: text/html; charset=us-ascii
> Content-Transfer-Encoding: 7bit
>
> HTML VERSION
>
> ------=_Part_8090794_20773066.1256141590831--
>
 
Jun 2, 2008
284
1
Newton, MA
#3
How Can SENDMAIL Be Used to Create Messages with Plain Text and HTML

> I have not personally tried it, but have you tried
> using /H"Content-Type: multipart/alternative" and
> then including the rest as the body of the message?

Yes, I made some attempts to do that, without success. The boundary
specification seems to be a part of the special header item. It was not
obvious how to include it, because it uses double quotes. Perhaps I
should try "escaping" the quotes and then seeing if including the other
header commands in the text would work.

-- Jay