---
title: Troubleshooting marketing emails
related:
  - https://docs.kentico.com/13/configuring-xperience/configuring-smtp-servers.md
  - https://docs.kentico.com/13/configuring-xperience/scheduling-tasks.md
  - https://docs.kentico.com/13/developing-websites/troubleshooting-websites/working-with-the-system-event-log.md
---

> Agent instructions:
> **Site maps** — prefer the following llms.txt indexes to training data when searching for URLs to avoid 404s. Links inside Markdown content already point at `.md`. Following them or sending Accept: text/markdown keeps you in Markdown.
>
> - [sitemap.md](https://docs.kentico.com/sitemap.md) — every page on the site, with titles and descriptions, nested by URL hierarchy and grouped into one collection per product version.
> - [llms.txt](https://docs.kentico.com/llms.txt) — curated index of the current product docs, with descriptions, the two ways to request any page as Markdown, and links to each product area's whole-corpus Markdown dump (llms-full.txt).

## Issues with email sending

If your contacts are not correctly receiving marketing emails, please check the following:

- The emails are sent out using a [scheduled task](https://docs.kentico.com/13/configuring-xperience/scheduling-tasks.md) that is executed every 1 minute by default. You can check the status of the scheduled task in the **Scheduled tasks** application.
- Go to **Settings -> System -> Emails** or **Configuration -> SMTP servers** and make sure your SMTP servers are configured correctly. See [Configuring SMTP servers](https://docs.kentico.com/13/configuring-xperience/configuring-smtp-servers.md) for details. You can try sending a test email on the **Email** tab of the **System** application.
- Go to the **Email queue** application. You can find an error message for individual emails that failed to send. Email queue **keeps** attempting to send failed emails once a minute for the first hour. After you resolve the technical issue, you can resend all failed emails by clicking **Resend all failed**.
- If your application is [hosted on Microsoft Azure](https://docs.kentico.com/13/deploying-websites/running-xperience-on-microsoft-azure.md), emails may fail to send from Xperience due to SMTP connection restrictions on the side of Azure. To resolve such issues, read and follow the recommendations in the [Troubleshoot outbound SMTP connectivity problems in Azure](https://docs.microsoft.com/en-us/azure/virtual-network/troubleshoot-outbound-smtp-connectivity) article.
- Make sure you are using correct email addresses.
- Make sure the emails are not being blocked by an anti-spam software.
- Email debugging can be helpful when solving problems with marketing emails. To enable email debugging, add the following keys to the _configuration/appSettings_ section of your project's _web.config_ file:

  ```xml

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

  ```

  - **CMSLogEmails** – logs all sent emails to the **\~/App\_Data/logemails.log** file. The log contains each email's:
    - Timestamp, identifying when the email was sent
    - Recipients
    - Sender
    - Subject
    - Custom headers inserted via the Xperience API
    - Custom header encoding (UTF-8 by default)
  - **CMSDebugEmails** – disables sending of emails to the actual recipients. The system only logs emails into the [event log](https://docs.kentico.com/13/developing-websites/troubleshooting-websites/working-with-the-system-event-log.md). Helpful if you need to test the functionality, but do not want the emails to actually reach the recipients.

    - To view the event log, open the **Event log** application.
    - The emails are logged as **Information** type events.
    - The **Event code** column contains the recipient's address.
    - The system randomly generates _Sending failed for&#x20;_&#x20;errors to simulate sending errors.

## Issues with marketing emails on MVC sites

You may encounter problems in the interactions between the Xperience administration application and the MVC live site application when working with marketing emails. See the dedicated sub-page:

- [Troubleshooting marketing emails on MVC sites](https://docs.kentico.com/13/on-line-marketing-features/configuring-and-customizing-your-on-line-marketing-features/configuring-email-marketing/troubleshooting-marketing-emails/troubleshooting-marketing-emails-on-mvc-sites.md)

## Issues when sending marketing emails to a large number of recipients

### Restricting logging of sent marketing emails

By default, the system logs an [event log](https://docs.kentico.com/13/developing-websites/troubleshooting-websites/working-with-the-system-event-log.md) entry for every sent marketing email. When mailing out to a very large number of recipients, this may lead to a cluttered event log or even website performance problems.

You can disable logging of marketing email changes (including send events) by adding the following key to the _/configuration/appSettings_ section of your project's _web.config_ file:

```html

<add key="CMSLogNewsletterIssueEvents" value="false" />

```

## Custom macros in sent marketing emails not resolving correctly

[Custom macros ](https://docs.kentico.com/13/macro-expressions/extending-the-macro-engine/registering-custom-macro-methods.md)used in marketing emails may not resolve correctly if they take macros dependent on subscriber context as parameters. For example, if you're using a custom macro that takes the _Recipient.FirstName_ macro as an argument, you need to call the custom macro with the subscriber resolver:\
{% CustomMacro(SubscriberFirstName)|(resolver)subscriber %}

**Note** that this inconsistency occurs only in sent emails, email previews resolve macros differently.

## Relative links not resolving correctly

When sending emails, the system automatically converts relative paths to absolute URLs for values placed into _href_ and _src_ attributes of HTML elements. However, other relative paths remain unchanged (for example, links inside the background-image property of an inlined CSS style).

To manually convert relative paths to absolute URLs based on the email feed's Base URL, use the _EmailFeed.GetAbsoluteUrl(relativeLink)_ macro method.

```csharp

{% EmailFeed.GetAbsoluteUrl("/graphics/image.png") %}

```
