How Can SENDMAIL Create Messages with Plain Text and HTML

Jun 2, 2008
373
2
Newton, MA
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,488
15
Solon, OH, USA
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
373
2
Newton, MA
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
 
Similar threads
Thread starter Title Forum Replies Date
Jay Sage How to? SENDMAIL with G-Suite Mail Account Support 6
vefatica SENDMAIL via smtp.gmail.com? Support 3
C How to? inline IMG with sendmail? Support 7
R TCC-RT sendmail Support 8
R Fixed Sendmail parameter /USER= does not work Support 4
C sendmail in v20.00.25 x64 Support 7
Mordachai How to pass URL to sendmail? Support 10
J Sendmail, SSL and MS Servers Support 11
C SendMail and yahoo.com Support 1
C Sendmail w/GMail - problem Support 6
C Google Sendmail ? Support 15
Joe Caverly How to? SendMail and SSL Support 2
Dan Glynhampton Fixed v15 sendmail : password encryption problem Support 18
Jay Sage SENDMAIL Apparently Not Setting Priority Support 2
S @CON: does not work with sendmail for pipe Support 2
vefatica SENDMAIL, command line override SMTP server? Support 2
Joe Caverly SENDMAIL under v14 Support 3
dcantor SENDMAIL /= missing field Support 4
C Using dif. sending addresses with sendmail Support 11
C sendmail TO name? Support 9
A Using SENDMAIL with Exchange Server Support 1
H Minor bug in v12 SENDMAIL Support 0
Jay Sage SENDMAIL Problem in TCC12 Support 10
dcantor Problem with SENDMAIL /H Support 4
C sendmail question Support 1
dcantor Feature request for SENDMAIL Support 0
S SENDMAIL attachment size limit Support 1
S SENDMAIL vs. RFC 2822 Support 0
S SENDMAIL vs. RFC 2822 Support 0
J Configure SendMail to go through GMAIL as SMTP server Support 10
Joe Caverly Create Windows Jobs and optionally attach processes to a job Support 17
E How to? Create a portable version of TCMD to use on other computers w/o installation Support 4
Alpengreis Fixed 0xc0000005 while try to create a button (Schaltfläche) Support 4
MickeyF create an alias with optional parameter Support 4
G How to? Trying to create TCC shortcut that opens with blue background (on Windows 8.1 x64) Support 1
noahcoad How to? Create shortcut with env var in path Support 4
S Problems to create new threads Support 6
C How to? create a JPSoft BTM menu to run custom custom batch files Support 2
A How to? Create a date range based upon creation date Support 2
S How to? Change thread prefix? Easy "create thread" method? Support 8
Stefano Piccardi Why did Windows create an encryption key? Support 5
S Create links or junctions on network drive Support 5
G create standalone .exe? Support 1
Charles Dye Create empty registry value? Support 5
M Strange error messages from TCC in FTP copy Support 7
vefatica Debug messages from TEE? Support 3
vefatica "Access denied" messages from DO Support 3
rconn News Site down, messages lost Support 0
B Fixed Error messages from TCMD.INI Support 2
S WAD DEL /E suppresses fatal ERROR messages Support 2

Similar threads