MiniM Knowledge Base | Nov 8, 2010
How to send SMTP mail with attachment
In many cases application servers use a mail messages through SMTP protocol and this article describes one of possible case to create and send SMTP mail message and message with an attachment.
Sample how to use SMTP mail contains three routines:
The SMTPSEND routine contains subroutines to create mail message parts
The basis of SMTP protocol is interaction with SMTP server over TCP/IP protocol in text mode and send message as special message headers, message body and attachments with special encoding.
Examples and utility contains embedded into code constant strings with email email@example.com, SMTP TCP port number by default and SMTP server by default. To use this routines in your application, of course, you must change or rewrite routines for you server settings and your email address.
First example SMTPEXAM1 sends simple text message with simple encoding.
Second example SMTPEXAM2 sends simple text message with BASE64 encoding and with file attachment and BASE64 encoding too.
Links with SMTP mail protocol:
this pages contain links to RFC documents with detailed description of recommended encoding and protocol implementations.
Download smtpsend.zip (zip, 2.5Kb)Eugene Karataev