Verify Email Delivery?

Question:
Is it possible to check if an email is delivered properly?

Answer:
The Chilkat MailMan is an SMTP client. It connects to an SMTP server to initiate the delivery of email. Typically you would connect to your company’s or ISP’s SMTP server. If the email is to be sent elsewhere, the SMTP server relays the email to the remote SMTP server (or to some other intermediate mail server). The SMTP client can only report back whether the initial “handoff” is successful. There are cases where the initial “handoff” fails, and these would result in a failed status return by the mail-sending method call.

Here is a collection of blog posts related to this topic:

Requesting Read Receipts and Delivery Receipts
http://www.chilkatsoft.com/p/p_313.asp

Diagnosing SMTP Failures
http://www.chilkatsoft.com/p/p_245.asp

RFC 3461 SMTP DSN Extension
http://cknotes.com/?p=8

SMTP Protocol in a Nutshell
http://cknotes.com/?p=40

Is it Possible to Connect Directly to the Recipient’s SMTP Server?
http://www.chilkatsoft.com/p/p_325.asp

Checking TCP Connectivity
http://www.chilkatsoft.com/p/p_172.asp

Email Bounce Processing Examples
* When sending email, you may set the email address’s BounceAddress property to specify a mailbox where bounces (i.e. DSN’s) are to be sent. You may write a separate application to read that mailbox using Chilkat Email (or Chilkat IMAP) in conjunction with the Chilkat Bounce component to categorize emails as bounces or not bounces, get the type of bounce, and the original sender (if possible).
ASP: Bounced Email Handling
C#: Bounced Email Handling
C++: Bounced Email Handling
MFC: Bounced Email Handling
C: Bounced Email Handling
Delphi: Bounced Email Handling
Visual FoxPro: Bounced Email Handling
Java: Bounced Email Handling
Perl: Bounced Email Handling
PHP: Bounced Email Handling
Python: Bounced Email Handling
Ruby: Bounced Email Handling
VB.NET: Bounced Email Handling
Visual Basic: Bounced Email Handling
VBScript: Bounced Email Handling

Sent Email not Found in Exchange’s “Sent Items” Folder?

Question:

After I send an email using Chilkat, I don’t see the email in the “Sent Items” folder in Exchange. How can this be done? Is it possible?

Answer:

The “Sent Items” folder is specific to Exchange/Outlook — it is not part of the SMTP protocol. You may use Chilkat IMAP to “append” a copy of the sent email to an Exchange folder (assuming the Exchange Server’s IMAP protocol is enabled). You would do this by calling Chilkat IMAP’s AppendMail or AppendMime method after the email has been successfully sent.

BounceAddress w/ SendMimeBytes and SendMime

Question:

I use SendMimeBytes Method of Mailman object to send Domain Keys Verified e-mails. But when I use this method  I can’ t use BounceAddress property to set up bounce addresses. For this reason I can’t get bounced e-mails as I want.

When I use SendMail Method everything is ok. What should I do to get bounce messages the address I want and Send Domain Keys Verified Mail?

Answer:

The 1st argument to the SendMime* methods is a “from” address.  This is the BounceAddress.  It is the email address passed to the SMTP server in the “FROM” command.  (It may be different than the From header field found in the MIME header.)  For further clarification, see SMTP Protocol in a Nutshell

Failed to get initial SMTP response..

Question:
I have 21 text message service applications running on a single PC. These apps send out weather alerts to radio station listeners several times a day. Each may have a few subscribers to a few hundred subscribers, so at the top of the hour, the messages for the people signed up for that hour are sent.
I sometimes get this error:

ErrorChilkatLog:
  SendEmail:
    DllDate: Aug 24 2008
    Username: User
    Component: ActiveX
    Recipients:
      NumTo: 1
      To: ****
      NumCC: 0
      NumBCC: 0
    Need new SMTP connection
    SMTP_Connect:
      Connecting to SMTP server mail.****.net:25
      smtp_host: mail.****.net
      smtp_port: 25
      smtp_user: abc@****.net
      numBytesRequested: 1000
      Connection closed by server.
      Socket is no longer readable
      InitialResponse:
      Failed to get initial SMTP response..
      The SMTP server may be denying access for this domain.
    Failed to connect to SMTP server.

Answer:

It’s possible that at times you have too many simultaneous connections to the SMTP server.  It may be that the SMTP server is immediately disconnecting from your program because of this condition.  Check your SMTP server configuration/settings to see if you can find anything related to the maximum number of sessions allowed.  It might also be caused by the fact that all sessions are coming from the same IP address, and the SMTP server might put a limit on this specific condition.

One possible solution is to have each instance of your application check and send email at different times.

Note: You may ignore this part of the error message:  “The SMTP server may be denying access for this domain.”  It only provides a suggestion for one possible cause of the problem.  If the SMTP server were denying access for the domain, you would either (1) never be able to establish the connection in the 1st place, or (2) every attempt to send email would fail.

Ms-Exch-SMTP-Submit Permissions problem seems like invalid login/password

This just came to our attention. When sending email using Exchange Server, a Ms-Exch-SMTP-Submit Permissions problem seems like an incorrect login/password error. A sample of the Chilkat.MailMan’s LastErrorXml is shown below. To get more information, Google “Ms-Exch-SMTP-Submit permission”…

<ChilkatLog>
<SendEmail>
<DllDate>Mar  6 2009</DllDate>
<UnlockPrefix>anything for 30-day trial</UnlockPrefix>
<Username>***</Username>
<Component>Java</Component>
<Recipients>
<NumTo>1</NumTo>
<To>***</To>
<NumCC>0</NumCC>
<NumBCC>0</NumBCC>
</Recipients>
<info>Need new SMTP connection</info>
<SMTP_Connect>
<info>Connecting to SMTP server smtp.***.net:25</info>
<smtp_host>smtp.***.net</smtp_host>
<smtp_port>25</smtp_port>
<smtp_user>***</smtp_user>
<InitialResponse><![CDATA[220 smtp.***.net Microsoft ESMTP MAIL Service ready at Thu, 12 Mar 2009 10:33:32 -0700
]]></InitialResponse>
<info>Sending STARTTLS (1)...</info>
<info>Received 503 SMTP Status...</info>
<info>Resending STARTTLS...</info>
<info>SSL Server Certificate verified.</info>
<ConnectionInfo>
<protocol>TLS1</protocol>
<cipher>ARC4</cipher>
<cipherStrength>128</cipherStrength>
<hash>MD5</hash>
<hashStrength>128</hashStrength>
<keyExchange>RSA</keyExchange>
<keyExchangeStrength>1024</keyExchangeStrength>
</ConnectionInfo>
<info>Secure Channel Established.</info>
<info>TLS connection established.</info>
<sendingHello><![CDATA[EHLO ***
]]></sendingHello>
<helloResponse><![CDATA[250-smtp.***.net Hello [111.111.111.111]
250-SIZE 52428800
250-PIPELINING
250-ENHANCEDSTATUSCODES
250-AUTH LOGIN
250-8BITMIME
250-BINARYMIME
250 CHUNKING
]]></helloResponse>
<login_method>LOGIN</login_method>
<error>535 5.7.3 Authentication unsuccessful</error>
<error>Failed to get response to login password</error>
<info><![CDATA[220 smtp.***.net Microsoft ESMTP MAIL Service ready at Thu, 12 Mar 2009 10:33:32 -0700
503 5.5.2 Send hello first
250-smtp.***.net Hello [111.111.111.111]
250-SIZE 52428800
250-PIPELINING
250-ENHANCEDSTATUSCODES
250-STARTTLS
250-AUTH
250-8BITMIME
250-BINARYMIME
250 CHUNKING
220 2.0.0 SMTP server ready
250-smtp.***.net Hello [111.111.111.111]
250-SIZE 52428800
250-PIPELINING
250-ENHANCEDSTATUSCODES
250-AUTH LOGIN
250-8BITMIME
250-BINARYMIME
250 CHUNKING
AUTH LOGIN
334 AAAAAAAAAAAA
334 BBBBBBBBBBBB
535 5.7.3 Authentication unsuccessful
]]></info>
<info>Failed to login using LOGIN method</info>
</SMTP_Connect>
<error>Failed to connect to SMTP server.</error>
</SendEmail>
</ChilkatLog>

Anti-Virus Blocking Application’s SMTP Connection

Occasionally, Chilkat will receive a support email from a customer with a problem described this way: Outlook can connect to my SMTP server and send email, but my application cannot. I’ve checked the settings and they are identical to those used by Outlook. What could the problem be?

The problem is often caused by an Anti-Virus program. The AV program allows known applications, such as Outlook, to send email, but blocks unknown applications (i.e. your application). The solution is to determine how to configure your Anti-Virus program to make an exception for your application (in other words — make your application a known non-threat).

The most recent customer having this problem was using Norton Anti-Virus while trying to connect to the HotMail SMTP server. The result of Norton AV blocking the connection was a 503 response to the SMTP STARTTLS command, as shown in the LastErrorText below:

...
<SMTP_Connect>
<info>Connecting to SMTP server smtp.live.com:25</info>
<smtp_host>smtp.live.com</smtp_host>
<smtp_port>25</smtp_port>
<smtp_user>*****@hotmail.com</smtp_user>
<InitialResponse><![CDATA[220 BLU0-SMTP34.blu0.hotmail.com Microsoft ESMTP MAIL Service, Version: 6.0.3790.2668 ready at  Wed, 4 Mar 2009 23:29:09 -0800 
]]></InitialResponse>
<info>Sending STARTTLS (1)...</info>
<info>Received 503 SMTP Status...</info>
<numBytesRequested>2048</numBytesRequested>
<error>Connection closed by server.</error>
<error>Failed to get EHLO response (2)</error>
</SMTP_Connect>
<error>Failed to connect to SMTP server.</error>
</SendEmail>
</ChilkatLog>

SMTP SSH Tunneling (Port Forwarding)

ASP: SMTP SSH Tunneling (Port Forwarding)
SQL Server: SMTP SSH Tunneling (Port Forwarding)
C#: SMTP SSH Tunneling (Port Forwarding)
C++: SMTP SSH Tunneling (Port Forwarding)
MFC: SMTP SSH Tunneling (Port Forwarding)
C: SMTP SSH Tunneling (Port Forwarding)
Delphi: SMTP SSH Tunneling (Port Forwarding)
Visual FoxPro: SMTP SSH Tunneling (Port Forwarding)
Java: SMTP SSH Tunneling (Port Forwarding)
Perl: SMTP SSH Tunneling (Port Forwarding)
PHP: SMTP SSH Tunneling (Port Forwarding)
Python: SMTP SSH Tunneling (Port Forwarding)
Ruby: SMTP SSH Tunneling (Port Forwarding)
VB.NET: SMTP SSH Tunneling (Port Forwarding)
Visual Basic: SMTP SSH Tunneling (Port Forwarding)
VBScript: SMTP SSH Tunneling (Port Forwarding)

Mail not sent when SendEmail returns success?

Question:
Looks to me like sendmail is returning true before the message has been sent but I’m sure you’ll tell me that there is no way this can happen…

Answer:
The SendEmail method returned true after the email was successfully handed over to the SMTP server. When the SMTP server decides to actually forward the email onward to its destination is another matter. Some SMTP servers wait until the SMTP client’s connection is terminated. Calling mailman.CloseSmtpConnection will do it.

Binding to an IP

Question:

I have a question about ‘binding’ Chilkat EMAIL to a specific socket in .NET. The reason why I’m asking is; the servers on which I’m using the component have multiple NIC’s and each NIC can have multiple IP’s assigned. I need to software-select through which IP the mails shall be sent.

Answer:

The Chilkat Mailman object provides a ClientIpAddress property that may be set to control the IP address used for binding.