solution: multi-part email using [sendmail]
This WebDNA talk-list message is from 2001
It keeps the original formatting.
numero = 36555
interpreted = N
texte = For those interested in sending multi-part emails that contain both plain text and HTML-styled information, here's a simple [sendmail] implementation that works. The result is that you can generate HTML-styled emails that are nicely formatted and viewable with newer email clients while at the same time generating plain-text emails that are viewable with older email clients.Here are some hints that I learned in trying to make this work:1. The Content-Type needs to be set to multipart/alternative (multipart/mixed didn't work for me)2. You need to be very careful about carriage returns. You need an extra line (2 CRs) between the Content-Type statement and the associated message.3. You need the ending boundary statement --[boundaryName]--4. It didn't seem to matter whether I quoted parameters or not. For example, boundary=1001 worked the same as boundary=1001.------------------------ START ------------------------[sendmail to=toName@myDomain.com&from=fromName@myDomain.com&subject=A multi-part message&date=[date]&time=[time]&MIME-version=1.0&Content-Type=multipart/alternative;boundary=1001]--1001Content-Type:text/html;charset=iso-8859-1
| Here's the HTML-styled message |
--1001Content-Type:text/plain;charset=us-asciiHere is the plain text message.--1001--[/sendmail]------------------------ END ------------------------Here's the resulting text file that is generated and put into the EmailFolder folder by WebCat (alternatively, you could use a [writefile] context to generate a file with this format instead of the [sendmail] context):------------------------ START ------------------------to: toName@myDomain.comfrom: fromName@myDomain.comsubject: A multi-part messagedate: 06/21/2001time: 21:53:47MIME-version: 1.0Content-Type: multipart/alternative;boundary=1001--1001Content-Type:text/html;charset=iso-8859-1
| Here's the HTML-styled message |
--1001Content-Type:text/plain;charset=us-asciiHere is the plain text message.--1001-------------------------- END -------------------------------------------------------------------------------------This message is sent to you because you are subscribed to the mailing list
.To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://search.smithmicro.com/
Associated Messages, from the most recent to the oldest:
| |
- solution: multi-part email using [sendmail] (Brian Wachter 2001)
|
For those interested in sending multi-part emails that contain both plain text and HTML-styled information, here's a simple [sendmail] implementation that works. The result is that you can generate HTML-styled emails that are nicely formatted and viewable with newer email clients while at the same time generating plain-text emails that are viewable with older email clients.Here are some hints that I learned in trying to make this work:1. The Content-Type needs to be set to multipart/alternative (multipart/mixed didn't work for me)2. You need to be very careful about carriage returns. You need an extra line (2 CRs) between the Content-Type statement and the associated message.3. You need the ending boundary statement --[boundaryName]--4. It didn't seem to matter whether I quoted parameters or not. For example, boundary=1001 worked the same as boundary=1001.------------------------ START ------------------------[sendmail to=toName@myDomain.com&from=fromName@myDomain.com&subject=A multi-part message&date=[date]&time=[time]&MIME-version=1.0&Content-Type=multipart/alternative;boundary=1001]--1001Content-Type:text/html;charset=iso-8859-1| Here's the HTML-styled message |
--1001Content-Type:text/plain;charset=us-asciiHere is the plain text message.--1001--[/sendmail]------------------------ END ------------------------Here's the resulting text file that is generated and put into the EmailFolder folder by WebCat (alternatively, you could use a [writefile] context to generate a file with this format instead of the [sendmail] context):------------------------ START ------------------------to: toName@myDomain.comfrom: fromName@myDomain.comsubject: A multi-part messagedate: 06/21/2001time: 21:53:47MIME-version: 1.0Content-Type: multipart/alternative;boundary=1001--1001Content-Type:text/html;charset=iso-8859-1| Here's the HTML-styled message |
--1001Content-Type:text/plain;charset=us-asciiHere is the plain text message.--1001-------------------------- END -------------------------------------------------------------------------------------This message is sent to you because you are subscribed to the mailing list .To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://search.smithmicro.com/
Brian Wachter
DOWNLOAD WEBDNA NOW!
Top Articles:
Talk List
The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...
Related Readings:
[WebDNA] Send Mail and SMTP Host (2015)
PCS Frames (1997)
HTML Editors (1997)
[WebDNA] isolatin-1 to utf-8 conversion (2013)
Search in 2 or more catalogs (1997)
Close-to Comparison Code (1998)
Random tags HELP!!!! (1999)
mySQL/OSX (2001)
Multiple cart additions (1997)
[WebDNA] Crashing Database (2011)
Webcatalog error, Plug-in for Webstar (1996)
[Sum] function? (1997)
Counting Inventory (2003)
MacAuthorize order data fields WAS:How To question... (1997)
Hiding usernames and passwords in URL (1998)
Changes to the List (1997)
WebCat2_Mac RETURNs in .db (1997)
Calculating Shipping charges for multiple items andqtys > 1 (1997)
Renaming users local files with WebDNA based solution (1969)
WebCat2 - Getting to the browser's username/password data (1997)