status (F,6) provides the return code. 0=success, else error. Negative numbers represent system or network errors (such as unable to connect, no route to host, etc.). The string associated with the error will be returned in errmsg (or output to the specified file.) Positive numbers>100 are the actual codes returned by the SMTP server (with the remainder of the message returned in errmsg.) Positive numbers between 71 and 99 are application or misc errors. The more common status values are defined in EMAILX.MAP (++include in your application) as shown below:
|
Symbol |
Value |
Type |
Description |
|
EMS'OK |
0 |
B,1 |
Ok |
|
EMS'TOOFEW |
71 |
B,1 |
Too few parameters |
|
EMS'TIMEOUT |
72 |
B,1 |
Timed out |
|
EMS'NOTO |
73 |
B,1 |
No to address |
|
EMS'NOBODY |
74 |
B,1 |
No body text |
|
EMS'BADRESP |
75 |
B,1 |
Bad SMTP response |
|
EMS'NOSOCKET |
76 |
B,1 |
No socket open |
|
EMS'NOCFG |
77 |
B,1 |
Specified CFG file not present |
|
EMS'BADCFG |
78 |
B,1 |
Syntax error within CFGFILE |
|
EMS'BADSIG |
79 |
B,1 |
Bad signature file |
|
EMS'BADATT |
80 |
B,1 |
Bad attachment |
|
EMS'B64ERR |
81 |
B,1 |
Base64 encoding error |
Values 1-70 would indicate Basic error conditions. (Consult SYS:ERRMSG.USA or use DERR.SBR to get the text message associated with the error number.). To get the error message associated with a negative value of STATUS, use XCALL MIAMEG,86,ABS(STATUS),MESSAGE$. Also see the ERRMSG parameter, which may contain a useful message, typically the last command sent to the server or last response from it.