The dtml-mime tag is used in conjunction with the dtml-sendmail tag to send attachments along with electronic mail messages16. The dtml-mime tag automatically sets the content type of the entire message to multipart/mixed. Thus, a variety of data can be attached to a single message using one or more dtml-boundary tags. Figure 16 uses the dtml-mime tag to attach the file, yearly_report, to an email formed by the dtml-sendmail tag.
<dtml-var standard_hmtl_header> <dtml-sendmail smtphost=gator.digicool.com> From: [email protected] <dtml-mime type=text/plain encode=7bit> <dtml-boundary type=application/octet-stream disposition=attachment encode=base64><dtml-var "yearly_report"> |
The dtml-mime tag and dtml-boundary tags contain several attributes, listed in Table 19, that specify MIME header information for their particular content. Since the opening dtml-mime tag in Figure 16 contains the body of the message, and does not require encoding, encode is set to 7bit.
Notice in Figure 16, there is no space between the opening dtml-mime tag and the TO: header. If a space is present, then the message will not be interpreted as by the receiving mailreader. Also notice, there are no spaces between the dtml-boundary, var or closing dtml-mime tags. I