Issue
How to troubleshoot email from controller
Environment
CX 9680
BCX 4040, 4000
BCX 9640
Cause
Troubleshooting SendEmail function.
Resolution
Below are the error codes that can be returned when using the SendEmail function.
Sample code:
Example 1
Program File
'Fall-thru program that sends a simple email message to a recipient
Numeric EmailStatus
Sending:
EmailStatus = SendEmail ("addr1@abc.com", "Lights", "We need to
save energy")
Checking:
If EmailStatus is 0 then EmailErrorString = Success"
Error Code |
Description |
0 |
No error |
1 |
Not called from a program |
2 |
Illegal argument value |
3 |
Illegal argument count |
4 |
Not enough memory to complete the operation |
11 |
Failed to create SMTP user session to the email server |
13 |
Email queue is temporarily full. The user should retry later |
14 |
Cannot connect to the email serve |
15 |
Error in sending the sender information |
16 |
Error in sending the TO recipient information |
17 |
Error in sending the CC recipient information |
18 |
Error in sending the BCC recipient information |
19 |
Error in sending the subject |
20 |
Error in sending the message |
21 |
Error in sending the end-of-message |
22 |
Error in disconnecting from the SMTP server |
23 |
Failed to resolve SMTP server address |
24 |
Invalid dialup settings |
25 |
Failed to connect remote SMTP server |
26 |
Modem port is in use |
27 |
Email settings are not configured |