Chilkat
HOME
Android™
ASP
Visual Basic
VB.NET
C#
iOS (IPhone)
Objective-C
C++
C
MFC
Delphi
FoxPro
Java
Perl
PHP Extension
PHP ActiveX
Python
PowerShell
Ruby
SQL Server
VBScript
SMTP Status Codes
Getting the SMTP server status response code for the last attempt of sending email. ' 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.
Private Sub Command15_Click()
' Here is our code for sending email, which you've probably seen over and over again by now...
Dim mailman As New ChilkatMailMan2
mailman.UnlockComponent "Anything for 30-day trial"
' Create a new email object...
Dim email As New ChilkatEmail2
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"
success = mailman.SendEmail(email)
If (success = 0) Then
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.
MsgBox mailman.LastErrorText
Else
MsgBox "Mail Sent!"
End If
End Sub
|
© 2000-2012 Chilkat Software, Inc. All Rights Reserved.