C# Examples

ChilkatHOMEAndroid™ASPVisual BasicVB.NETC#iOS (IPhone)Objective-CC++CMFCDelphiFoxProJavaPerl
PHP ExtensionPHP ActiveXPythonPowerShellRubySQL ServerVBScript

C# Examples

Bounced Mail
Bz2
Character Encoding
CSV
DKIM / DomainKey
Digital Certificates
Digital Signatures
Email
Email Object
FTP
HTML Conversion
HTTP
IMAP
Encryption
MHT / HTML Email
MIME
POP3
RSA
S/MIME
SMTP
Socket
Spider
SSH
SSH Tunnel
SSH Key
SFTP
Tar Archive
Upload
XML
XMP
Zip Compression


More Examples...
Amazon S3
NTLM
FileAccess
RSS
Atom
String
Byte Array
Self-Extractor
Service
PPMD
Deflate
DH Key Exchange
DSA
Bzip2
LZW

 

 

 

 

 

 

SMTP Status Codes

Download: Chilkat .NET Assemblies

Discusses the mailman.LastSmtpStatus property which contains the last status code received from an SMTP server.

    // The mailman.LastSmtpStatus property contains the SMTP server status
    // reply code for the last email sent (or attempted to be sent).
    // You may use this as part of an error-recovery scheme.

    // Here is our code for sending email, which you've probably seen over and over again by now...
    Chilkat.MailMan mailman = new Chilkat.MailMan();
    mailman.UnlockComponent("Anything for 30-day trial");
        
    // Create a new email object...
    Chilkat.Email email = new Chilkat.Email();
    email.Subject = "This is a test";
    email.Body = "This is the mail body";
    email.AddTo("Chilkat Support", "support@chilkatsoft.com");
    email.From = "Chilkat Sales <sales@chilkatsoft.com>";
        
    mailman.SmtpHost = "smtp.comcast.net";

    bool success = mailman.SendEmail(email);
    if (!success)
    {
        int smtpStatus = mailman.LastSmtpStatus;
        
// Some common SMTP status codes are as follows:
// 211 - System status message.
// 214 - Help message formatted for human reader follows.
// 220 - SMTP service ready.
// 221 - Service/connection closing.
// 250 - Successful request. Action completed.
// 251 - Recipient is not local to the server, but the server will accept and forward the message.
// 252 - Recipient cant be verified, but the server will accept the message and attempt delivery.
// 354 - Start message input now, end with .. Indicates the server is ready to accept a message once youve given it From: and To: information
// 421 - Service is not available and connection will be closed.
// 450 - Requested command failed because the recipients mailbox is unavailable.
// 451 - Command has been aborted due to a server error. Possibly notify your SysAdmin.
// 452 - Command has been aborted because the server has insufficient system storage.
// 500 - Server could not recognize the command was due to a syntax error. (usually due to mail client error)
// 501 - Syntax error was found in command arguments. (usually due to mail client error)
// 502 - Command was not implemented. (usually due to mail client error)
// 503 - Server has encounterd a bad command or sequence of commands. (usually due to mail client error)
// 504 - Command parameter is not implemented. (usually due to mail client error)
// 550 - Command failed because the users mailbox was unavailable (or you did not have permissions to send to this mailbox)
// 551 - Recipient is not local to the server. Server responds with a fowarding address that should be tried.
// 552 - Action was aborted because storage allocation was exceeded.
// 553 - Action was aborted because the mailbox name was invalid.
// 554 - Transaction failed, without a clear reason.
        
        MessageBox.Show(mailman.LastErrorText);
    }
    else
    {
        MessageBox.Show("Send Complete!");
    }

Important: The download for this example does not contain the ChilkatDotNet.dll which
must be downloaded and installed separately at http://www.chilkatsoft.com/downloads.asp.
Once installed, add a reference to the DLL in the project by following the instructions at
http://www.example-code.com/vbdotnet/step2.asp

 

© 2000-2012 Chilkat Software, Inc. All Rights Reserved.

Email Component · XML Parser