Examples of the Mail command

The following are examples of the Mail command used in a script. For a description of the Mail command, see Mail.

Mail
    File("c:\mail\mime.txt")
    Host (smtp_server)
    From (sender@somewhere.com)
    To (somebody@somewhere.com, somebodyelse@somewhere.com)
    Attachments("c:\mail\body.txt,c:\mail\body.html,
                  [logo@aia.nl]c:\images\logo.gif,
                   [signature@aia.nl]c:\images\signature.jpg"),
                    c:\mail\invoice.doc,c:\mail\replyletter.doc");

A sample content of the mime.txt file.

Subject: Your request dated 18 Jul 2002
To: "F Gonzales" <F.Gonzales@host.domain.com>
Reply-To: "Web Office" <Internet@host.domain.com>

This mail is meant to be read using a MIME-enhanced e-mail client. 
If you can see this text your client is NOT MIME-enhanced. 
Please ask your system operator for assistance.

A sample content of the body.txt file.

Dear Mr. Gonzales,
......
Please find the following documents attached:
- Your invoice.
- A reply letter.
......

A sample content of the body.html file.

<html>
<img src = "cid:logo@aia.nl" align="right" border="0">
Dear Mr. Gonzales,<p>
..........
Please find the following documents attached:<br>
<ul>
<li> Your invoice.</li>
<li> A reply letter.</li>
</ul>
.......
With kind regards,
<img src = "cid:signature@aia.nl" border="0">
</html>

Any email client that is MIME enhanced shows the header lines from the mime.txt document and displays the content of either the body.txt or body.html file as the body of the email. The choice of which version of the body is shown depends of the preferences of the recipient. A non-MIME enhanced email client shows the MIME message from mime.txt.

MIME types for attachments are read from the Windows Registry.