phpmailer Exception while using Pixel & Tonic contact-form plugin Link to Github repository for plugin: https://github.com/pixelandtonic/ContactForm

Being given an error by the plugin where it is interpreting my Twig variable literally as a string instead of what the variable is representing. I am looking for a way to fix this using the current set-up but having an alternate setup is fine as well. Also for reference, I have followed the guidelines on the README in regards to changing the craft/config/contactform.php file. Much appreciated for the help!

This is my code:

{% macro errorList(errors) %}
{% if errors %}
    &lt;ul class="errors"&gt;
        {% for error in errors %}
            &lt;li&gt;&lt;span&gt;{{ error }}&lt;/span&gt;&lt;/li&gt;
        {% endfor %}
    &lt;/ul&gt;
{% endif %}
{% endmacro %}

{% from _self import errorList %}

&lt;div class="uk-width-large-1-2 uk-width-medium-1-2 uk-width-small-1-1 uk-container-center"&gt;
&lt;form method="post" action="" accept-charset="UTF-8"&gt;
    {{ getCsrfInput() }}
    &lt;input type="hidden" name="action" value="contactForm/sendMessage"&gt;

    &lt;ul id="button-content" class="uk-switcher uk-margin"&gt;
        &lt;li class="text-space basic-border"&gt;
            &lt;h3&gt;&lt;b&gt;Email to {{default.defaultcontactreason}}&lt;/b&gt;&lt;/h3&gt;
            &lt;input type="hidden" name="toEmail" value="{{ '{{default.defaultContactEmail}}'|hash }}"&gt;{{default.defaultContactEmail}}
        &lt;/li&gt;
    {% for category in craft.entries.section('Contacts') %}
        &lt;li class="text-space basic-border"&gt;
            &lt;h3&gt;&lt;b&gt;Email to {{ category.contactReason }}&lt;/b&gt;&lt;/h3&gt;
            &lt;input type="hidden" name="toEmail" value="{{ '{{category.contactEmail}}'|hash }}"&gt;{{category.contactEmail}}
        &lt;/li&gt;
    {% endfor %}
    &lt;/ul&gt;

    &lt;h3&gt;&lt;label for="fromName"&gt;Your Name&lt;/label&gt;&lt;/h3&gt;
    &lt;input id="fromName" type="text" name="fromName" value="{% if message is defined %}{{ message.fromName }}{% endif %}"&gt;
    {{ message is defined and message ? errorList(message.getErrors('fromName')) }}

    &lt;h3&gt;&lt;label for="fromEmail"&gt;Your Email&lt;/label&gt;&lt;/h3&gt;
    &lt;input id="fromEmail" type="text" name="fromEmail" value="{% if message is defined %}{{ message.fromEmail }}{% endif %}"&gt;
    {{ message is defined and message ? errorList(message.getErrors('fromEmail')) }}

    &lt;h3&gt;&lt;label for="subject"&gt;Subject&lt;/label&gt;&lt;/h3&gt;
    &lt;input id="subject" type="text" name="subject" value="{% if message is defined %}{{ message.subject }}{% endif %}"&gt;
    {{ message is defined and message ? errorList(message.getErrors('subject')) }}

    &lt;h3&gt;&lt;label for="message"&gt;Message&lt;/label&gt;&lt;/h3&gt;
    &lt;textarea rows="10" cols="40" id="message" name="message"&gt;{% if message is defined %}{{ message.message }}{% endif %}&lt;/textarea&gt;
    {{ message is defined and message ? errorList(message.getErrors('message')) }}

    &lt;input type="submit" value="Send"&gt;
    &lt;input type="hidden" name="redirect" value="{{siteUrl}}Contacts"&gt;
&lt;/form&gt;
&lt;/div&gt;
Looks like you've got some nested escape tags in Twig, which is a no-no.

value="{{ '{{category.contactEmail}}'|hash }}"


You just need to use:

value="{{ category.contactEmail|hash }}"