Kentico CMS 7.0 Developer's Guide

E-mails

E-mails

Previous topic Next topic Mail us feedback on this topic!  

E-mails

Previous topic Next topic JavaScript is required for the print function Mail us feedback on this topic!  

E‑mail debugging can help you resolve problems with newsletter, notification and other e-mails sent by Kentico CMS. To enable it, add the following keys to the web.config file of your web project:

 

<add key="CMSLogEmails" value="true" />
<add key="CMSDebugEmails" value="true" />

 

The first key enables you to log all the sent e-mails. You can find the logged e-mails in <web root>/AppData/logemails.log. The log contains each e-mail's recipient and subject. The following extract from the log shows 2 newsletters sent to 3 recipients each.

 

Rcpt: subscriber@localhost.local

Subject: Newsletter #1

 

Rcpt: subscriber2@localhost.local

Subject: Newsletter #1

 

Rcpt: subscriber3@localhost.local

Subject: Newsletter #1

 

Rcpt: subscriber@localhost.local

Subject: Newsletter #2

 

Rcpt: subscriber2@localhost.local

Subject: Newsletter #2

 

Rcpt: subscriber3@localhost.local

Subject: Newsletter #2

 

The second key enables you to log all the sent e-mails into event log without actually sending them to the recipients. This is helpful when you need to test the functionality but do not want the testing e-mails to actually reach the recipient.

 

You can view the event log in Site Manager -> Administration -> Event log. The e-mails are logged as an Information type of event. The following picture shows a logged e-mail sent to three different recipients. The recipient's address is mentioned in the Event code column of the Event log.

 

devguide_clip1145

 

Additionally, with the second key enabled, a 'Sending failed for <recipient's e-mail address>' error is generated at random to simulate an error when sending an e-mail.

 

You can find more information on viewing logged events in Developer's guide -> Modules -> Event log.