@SendMail() Error Codes.
@Sendmail is an SBasic programming command that sends an email message using the information in your database. @SendMail returns 0 if the function succeeded (the email was sent). A non-zero return value indicates a failure. The list of these return values are below.
-1 Unable to connect to SMTP server on SMTP port. Check internet connection, spelling of SMTP server name and SMTP port number of SMTP server.
-2 Failure from SMTP server after initial connection (after HELO was sent). Possible causes are trying to access a SMTP server that requires a login and password without specifying one.
-3 Failure from SMTP server after sending from address. Check the From address to verify that it is a valid email address.
-4 Failure from SMTP server after sending recipient list. Check the To, CC and BCC addresses to verify that they are a valid email address.
-5 Failure from SMTP server after sending body and subject of email
-6 Failure to open attachment files for sending. Check file path, that the file exists and that the current user has read permission to the file
-7 Failure from SMTP server after sending end of message tag.
-8 Failure from SMTP server after sending log off command.
-9 Authorization failure. Check spelling of username and password