GetRecipientDetails
Get the response code and message from the SMTP server for each recipient that was not accepted during the last Send() operation.
GetRecipientDetails(
ToDetails , CcDetails,
BccDetails)
Parameters
Each parameter is an associative list containing
the SMTP reply code and SMTP reply text for each recipient address that was not accepted, in the
format:
EmailAddress=
ReplyCode;
ReplyText.
The size is limited to 102400 bytes.
Option | Type | Direction |
---|---|---|
ToDetails | string | Out |
CcDetails | string | Out |
BccDetails | string | Out |
Return Values
Value | Description |
---|---|
0 | Success |
-10 | Miscellaneous error |
Description
Use GetRecipientDetails after the Send operation to get the SMTP response code and message for each recipient that was not accepted. This enables you to get more details than GetSMTPResponse.
SMTP codes consist of three digits, that each
have a special meaning. Reply codes that begin with 4
or 5
indicate an error that prevents the message from being sent.
Reply Code | Meaning |
---|---|
421 | Service not available, closing transmission channel |
450 | Requested mail action not taken: mailbox unavailable |
451 | Requested action aborted: local error in processing |
452 | Requested action not taken: insufficient system storage |
500 | Syntax error, command unrecognized (This may include errors such as command line too long) |
501 | Syntax error in parameters or arguments |
502 | Command not implemented |
503 | Bad sequence of commands |
504 | Command parameter not implemented |
535 | Authentication credentials invalid |
550 | Requested action not taken: mailbox unavailable (for example, mailbox not found, no access) |
551 | User not local |
552 | Requested mail action aborted: exceeded storage allocation |
553 | Requested action not taken: mailbox name not allowed (E.g., mailbox syntax incorrect) |
554 | Transaction failed |
For more information, consult the SMTP and Extended SMTP standards.
GetRecipientDetails if IgnoreRcptError=True
In the following example, an email is sent only to
CC recipients. Assuming that b@c.com
is not accepted,
GetRecipientDetails will return the following content to the
vCcErr
variable: "b@c.com=550·;Unable to relay"
... ; Define a list of CC recipients vCcList = "a@b.com·;b@c.com·;c@d.com" mailApiHandle->SetCCList(vCcList) ; Send the mail vResult = mailApiHandle->Send("IgnoreRcptError=True") ; Handle the result vToErr = "" vCcErr = "" vBccErr = "" if (vResult>0) mailApiHandle->GetRecipientDetails(vToErr,vCcErr,vBccErr) else if (vResult<0) ... endif ...