Previously I had posted about inconsistent SMTP client issues using the TCPnet library (http://www.keil.com/forum/56776/). The consensus of the forum was to get debug information and post it and so I have done that below. The debug library is configured to print out any error conditions and a full debug on the SMTP client itself.
As far as hardware goes the Ethernet driver is an ENC28J60 and the MCU is an LPC2148.
One of three things happens repeatedly: it either works and sends and email, or it fails to get IP, or it just 'fails to send'.
Failed to Send (SMTP callback function returns with the code EVT_EVENT_ERROR) ------------------------------------------------------------------------------------------- SMTP:Init Client SMTP:Connect Client SMTP: Server: 74.220.215.246 SMTP: Port : 26 TCP-ERR:Socket 1, No Retries left SMTP-ERR:Client stop, Socket aborted Fails to get IP Address via DHCP ------------------------------------------------------------------------------------------- SMTP:Init Client Sends Correctly ------------------------------------------------------------------------------------------- SMTP:Init Client SMTP:Connect Client SMTP: Server: 74.220.215.246 SMTP: Port : 26 ******** TCP-ERR:Socket 1, Unknown frame received ******* (this line only occurs sometimes but the sending still works properly) SMTP:Socket connected SMTP:*** Processing frame *** SMTP: Received length: 181 bytes SMTP: Server is ready SMTP: Sending: EHLO lookout SMTP:*** Processing frame *** SMTP: Received length: 138 bytes SMTP: EHLO acked, ESMTP mode SMTP: Start Authentication SMTP: Sending: AUTH LOGIN SMTP:*** Processing frame *** SMTP: Received length: 18 bytes SMTP: Sending: d2VzbGV5QGxvb2tvdXRwb3J0YWJsZXNlY3VyaXR5LmNvbQ== SMTP:*** Processing frame *** SMTP: Received length: 18 bytes SMTP: Sending: d2VzbGV5MTIzNA== SMTP:*** Processing frame *** SMTP: Received length: 30 bytes SMTP: Authentication successful SMTP: Sending: MAIL FROM: <email@example.com> SMTP:*** Processing frame *** SMTP: Received length: 8 bytes SMTP: Server acknowledge SMTP: Sending: RCPT TO: <email2@example.com> SMTP:*** Processing frame *** SMTP: Received length: 14 bytes SMTP: Server acknowledge SMTP: Sending: DATA SMTP:*** Processing frame *** SMTP: Received length: 56 bytes SMTP: Server acknowledge SMTP: Sending 'Message Body' SMTP:*** Processing frame *** SMTP: Received length: 28 bytes SMTP: End of Message acknowledge SMTP: Sending: QUIT SMTP:*** Processing frame *** SMTP: Received length: 48 bytes SMTP: Server acknowledge SMTP: Client done, close socket