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.

Exchange Server – POP3, IMAP, and SMTP

Question:

May I ask if is possible use Chilkat components to connect to MS Exchange 6.5 and higher ?
I am thinking about purchase of MailMan component or other as it is, however I would like read some example in C# for reading emails from Exchange and sending emails via Exchange
after connecting to the specified account domain/logname & password.
May I see some examples somewhere on your site?
May you recommend correct components please ?

Answer:

Exchange Server (including v6.5 and higher) implements the server-side of the POP3, IMAP, and SMTP protocols.  Therefore, any software that implements the client-side of these protocols will work with Exchange Server in exactly the same way as any other email server. (See the note below regarding NTLM authentication.)

The purpose of a protocol is to allow any client-side implementation to communicate with any server-side implementation.  As long as each side correctly implements the protocol to specification, everything works.  For example, a web browser implements the client-side of the HTTP protocol.  You may not realize it, but it communicates with many different web server implementations: IIS, Apache, etc.  You can browse the web because the both clients (i.e. web browsers) and servers correctly implement the HTTP protocol.

Therefore, all of the examples involving POP3, SMTP, and IMAP at http://www.example-code.com are examples that will work with Exchange Server.

The Chilkat Email license ($99 for a 1-Developer license) is what you would need for the POP3 and SMTP functionality.  The Chilkat IMAP license ($199 for a 1-Developer license) includes all three: POP3, SMTP, and IMAP.  Note: 1-Developer does not mean “1-Computer”.  It simply means that one person may develop programs using the component.  All Chilkat licenses allow for royalty-free redistribution, meaning you may use the component/library on any number of computers.

*** MS Exchange implements an additional authentication mechanism called “NTLM”, which is also known as Windows Integrated Authentication.   Chilkat supports NTLM for POP3, IMAP, and SMTP.

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>

SMTPQ max threads?

Question: With the SMTPQ service, do you have some guidelines on the best practice
settings for the number of threads required for sending different quantities
of email?

Answer:
The SMTPQ is an SMTP client, and thus it connects to SMTP servers to send email. However, it may be configured to use any number of threads so theoretically each thread may be communicating with a different SMTP server. The SMTP server to be used for an email is determined at the time mailman.SendQ is called. The mailman.SmptHost property value, and other mailman property settings such as SMTP login/password, encryption/signing requirements, etc. are included with the email passed to SMTPQ.

To answer the question: If all of your emails are sent via the same SmtpHost, you wouldn’t want to overload that SMTP server by using too many SMTPQ threads. Also, some SMTP servers limit the number of simultaneous connections accepted from a single IP address, so if the SMTPQ thread count is too high, and they are all trying to send via the same SMTP server, some will be rejected.

This blog post provides more information about using multiple SMTP servers in a round-robin fashion:
SMTP Round-Robin

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)