Zip Component, Email Component, Encryption Component ActiveX Control for Zip Compression .NET Components for ASP.NET
ActiveX and .NET Components for Zip Compression, Encryption, Email, XML, S/MIME, HTML Email, Character Encoding, Digital Certificates, FTP, and more ASP Email ActiveX Component

Index of Chilkat Blog Posts

November 15, 2007

Using undisclosed recipients / Send Failed

Your program should verify that it does not pass an email address that is empty to the email object’s AddTo method. The AddTo method returns a true/false success value. If a zero-length email address is passed to it, a false value is returned. If you do not check and try to send email to no recipients, you’ll get the error message as described below.

Here is sample C# code that shows how to reproduce this error. The error messages follow:

//  The mailman object is used for sending and receiving email.
Chilkat.MailMan mailman = new Chilkat.MailMan();
//  Any string argument automatically begins the 30-day trial.
bool success;
success = mailman.UnlockComponent("30-day trial");
if (success != true) {
    MessageBox.Show("Component unlock failed");
//  Set the SMTP server.
mailman.SmtpHost = "";
//  Create a new email object
Chilkat.Email email = new Chilkat.Email();
email.Subject = "This is a test";
email.Body = "This is a test";
email.From = "Chilkat Support <>";
string friendlyName = "Chilkat Support";
string emailAddr = "";
//  Pass an empty string for the email address:
success = email.AddTo(friendlyName,emailAddr);
if (success != true) {
//  Let's send the email anyway, even though there are no
//  valid recipients.  We'll get an error....
success = mailman.SendEmail(email);
if (success != true) {
else {
    MessageBox.Show("Mail Sent!");

The email object’s LastErrorText will contain this (immediately after the call to AddTo):

    DllDate: Nov 13 2007
    name: Chilkat Support
    No Email Address was provided

The mailman’s LastErrorText contains the following. Notice that NumSuccess and NumTotal are both 0 — indicating that no recipients were ever added to the email. This is the clue that tells you that AddTo was never called, or if it was, an empty string was passed to it.

    DllDate: Nov 13 2007
    Username: Chilkat
    Component: Ruby
      Connecting to SMTP server
      smtp_port: 25
      smtp_user: NULL
      trying-auth-method: NONE
      InitialResponse: 220 comcast ESMTP server ready
      sendingHello: EHLO CK2007
      helloResponse: hello [66.173.223
.150], pleased to meet you
250-SIZE 15728640
250 OK
      smtpAuthMethod: NONE
      login_method: NONE or already authenticated
      CONNECTED to ESMTP server
    Using undisclosed recipients
    subject: This is a test
    NumSuccess: 0
    NumTotal: 0
    Send failed.

Privacy Statement. Copyright 2000-2011 Chilkat Software, Inc. All rights reserved.
Send feedback to

Components for Microsoft Windows XP, 2000, 2003 Server, Vista, Windows 7, and Windows 95/98/NT4.