This article details steps that can be taken to debug email issues in OrderCentral ASP.NET 1.1. See Configuring OrderCentral Emails .NET 1.1 for more information on configuring ctEmail and OrderCentral correctly.
After verifying all web.config keys are set correctly in ctEmail/web.config and OrderCentral/web.config we move onto diagnostics.
General Debug Settings and Error Logging:
- Verify that following key is in place and have the same value in both ctEmail/web.config and OrderCentral/web.config
- Enable debugMode in ctEmail/web.config. Make sure to set the errorLogFile to a writeable path.
Note: For performance reasons: remember to disable debugMode (false) when finished debugging.
- Trigger an email event on the OrderCentral website.
ie: place an order or forgot password.
Note: It is often best is to trigger the same specific email template you are having problems with.
- Review the ctEmail errorLogFile. This will contain error messages from the smtp server and log email template urls.
Reviewing and Resending OrderCentral emails:
- If useOCEmailServer is set to TRUE in ctEmail/web.config and OrderCentral/web.config then all emails are serialized and stored in the following sql table: xct_messageQueue
- The following sql statement will retrieve all currently queued emails.
SELECT * FROM xct_messageQueue with(nolock)
WHERE objectType = 'EMAIL'
AND messageType = 'OCEMAIL'
AND queueStatus = 'QUEUE'
AND messageBody IS NOT NULL
ORDER BY messageDateTime
- The field: xct_messageQueue.messageBody holds the serialized email XML content. This can be reviewed to very the recipient or other problems with specific emails.
- If an email needs to be resent. Update the queueStatus field to QUEUE. The email will then be sent out at the next polling interval. (configured in OrderCentral/web.config file)
UPDATE xct_messageQueue
SET queueStatus = 'QUEUE'
WHERE messageID = @messageID /*@messageID is the unique key for a particular email (xct_messageQueue.messageID) */