SMTP Protocol (in a Nutshell)


SendMime requires a from  and  recipients address string, but the MIME message contains both .  The message I receive from the SendMime seems to ignore the addresses in the call and uses the one in the MIME.  So why require a from and recipient address?


The SMTP protocol works like this:

1) A client connects to an SMTP server.

2) The SMTP server says “hello”

3) The client authenticates (if necessary) by logging in.

4) Now it’s time to send an email.  First, the client sends a “MAIL FROM” command with the email address that is the reverse-path.  This is the email address that would receive a bounce or delivery status notification.

5) The client then sends one or more “RCPT TO” commands, each with a recipient email address.  It doesn’t matter if the recipient is a “To” , “CC”, or “BCC”, all recipient email addresses are passed to the SMTP server via “RCPT TO” commands.

6) Finally, the MIME source of the email is sent with a “DATA” command.    Note: The MIME source has header fields for “From”, “To”, and “CC”.  These are the email addresses that will be seen by the receiver of the email.  The actual recipients are the email addresses passed via the RCPT TO commands.  It’s possible to create an email such that the “To” header field contains “”, but you pass actual email addresses in the RCPT TO commands.  The person receiving such an email (if not filtered as SPAM) would scratch his/her head and wonder why he/she received an email addressed to Santa Claus.

The Chilkat mailman’s SendMime method has these arguments:  From, CommaSeparatedRcptToEmailAddresses, MimeSource.    Given the above explanation, it should be obvious how these arguments are used in sending the email…

Tags :