smtpmail.p with formatted message body

Posted by jlacok on 12-Sep-2017 13:37

Hello

OE 11.3 - AIX 7.1

We need to send emails to the clients from our application, with graphic, tables, formatted text... in message body itself (not as an attachment). What will be the easiest way to do this on 'plain' AIX - with just 'plain' 4GL.

We can create the 'MHT' file (MHTML format). Can this file be embedded directly into email body and emailed using smtpmail.p? If yes which parameters need to be specified and how (we are using smtpmail.p to email PDF/ZIP attachments)? Or this will now be correct way to approach this?

Thanks

Jan

Posted by jbijker on 13-Sep-2017 02:42

The best way would be format your email body in MIME format.

Normally you should be using multipart/alternative - one for plain text and one for HTML. If you don't specify a plain text alternative your email might be flagged as spam.

For example (stolen from http://www.enewsletterpro.com/articles/multi_part_mime_messages.asp):

X-sender: <sender@sendersdomain.com>
X-receiver: <somerecipient@recipientdomain.com>
From: "Senders Name" <sender@sendersdomain.com>
To: "Recipient Name" <somerecipient@recipientdomain.com>
Message-ID: <5bec11c119194c14999e592feb46e3cf@sendersdomain.com>
Date: Sat, 24 Sep 2005 15:06:49 -0400
Subject: Sample Multi-Part
MIME-Version: 1.0
Content-Type: multipart/alternative;
boundary="----=_NextPart_DC7E1BB5_1105_4DB3_BAE3_2A6208EB099D"

------=_NextPart_DC7E1BB5_1105_4DB3_BAE3_2A6208EB099D
Content-type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
Sample Text Content
------=_NextPart_DC7E1BB5_1105_4DB3_BAE3_2A6208EB099D
Content-type: text/html; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
<html>
<head>
</head>
<body>
<div style=3D'FONT-SIZE: 10pt; FONT-FAMILY: Arial'>Sample HTML =
Content</div>
</body>
</html>
------=_NextPart_DC7E1BB5_1105_4DB3_BAE3_2A6208EB099D--

If your MHT file contains all the boundaries you can use that as-is in your email body.

 

All Replies

Posted by jbijker on 13-Sep-2017 02:42

The best way would be format your email body in MIME format.

Normally you should be using multipart/alternative - one for plain text and one for HTML. If you don't specify a plain text alternative your email might be flagged as spam.

For example (stolen from http://www.enewsletterpro.com/articles/multi_part_mime_messages.asp):

X-sender: <sender@sendersdomain.com>
X-receiver: <somerecipient@recipientdomain.com>
From: "Senders Name" <sender@sendersdomain.com>
To: "Recipient Name" <somerecipient@recipientdomain.com>
Message-ID: <5bec11c119194c14999e592feb46e3cf@sendersdomain.com>
Date: Sat, 24 Sep 2005 15:06:49 -0400
Subject: Sample Multi-Part
MIME-Version: 1.0
Content-Type: multipart/alternative;
boundary="----=_NextPart_DC7E1BB5_1105_4DB3_BAE3_2A6208EB099D"

------=_NextPart_DC7E1BB5_1105_4DB3_BAE3_2A6208EB099D
Content-type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
Sample Text Content
------=_NextPart_DC7E1BB5_1105_4DB3_BAE3_2A6208EB099D
Content-type: text/html; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
<html>
<head>
</head>
<body>
<div style=3D'FONT-SIZE: 10pt; FONT-FAMILY: Arial'>Sample HTML =
Content</div>
</body>
</html>
------=_NextPart_DC7E1BB5_1105_4DB3_BAE3_2A6208EB099D--

If your MHT file contains all the boundaries you can use that as-is in your email body.

 

Posted by jlacok on 13-Sep-2017 10:36

Thanks for your reply. We will check it out.

Posted by scott_auge on 13-Sep-2017 19:04
This thread is closed