<p>Welcome to Craft!</p>

<p>You mention you haven't configured any kind of mail server—this is almost certainly the issue.</p>

<p>There are a few mailer adapters for Craft, the availability of which will depend on whether you're using Craft 2 or Craft 3.</p>

<p>That said, the easiest route will probably be to use the built-in SMTP method, configured in the <code>Settings -&gt; Email</code> screen of the Admin.</p>

<p>I'd recommend checking out <a href="https://mailgun.com" rel="nofollow noreferrer">Mailgun</a> or <a href="http://sendgrid.com" rel="nofollow noreferrer">Sendgrid</a> as third-party services that handle mail delivery—this way, you're not responsible for maintaining your own mail server. Both offer generous free tiers that should cover most use cases.</p>

<p>Each should provide you with some SMTP credentials you can drop into Craft's settings.</p>

<p>Be aware: some ISPs will block SMTP traffic over the standard port. If you still have trouble sending mail, look at the docs for your chosen provider and see if they support sending over an alternate port.</p>

<p>Good luck!</p>

CC BY-SA 4.0
2018-06-08T22:00:19.803Z
Probably worth mentioning as well: https://craftcms.com/support/troubleshooting-email-errors
Brad Bell
CC BY-SA 4.0
2018-06-08T22:15:46.547Z
Hadn't seen this before! Thanks, @BradBell!
August Miller
CC BY-SA 4.0
2018-06-10T18:59:11.743Z
Hey @AugustMiller thanks a lot for your suggestions. I made an account on Mailgun and managed to use a Mailgun plugin for Craft 3 to set up the API key interaction in the settings. The "test" email is working fine however I'm not sure how to make it interact with the plugin "Contact Form" or how to make write my contact form now that the email settings seem to be working. Any advice om this? Thanks!
Nicolas Barse
CC BY-SA 4.0
2018-06-11T23:29:14.907Z
Just to confirm—have you set the required Contact Form preferences in the Control panel or via a config file? https://github.com/craftcms/contact-form#overriding-plugin-settings
August Miller
CC BY-SA 4.0
2018-06-11T23:32:28.823Z
Internally, the Contact Form plugin uses Craft's mailer service, which acts as a bridge between any calls to send mail and the provider itself—this is just to say that there shouldn't be any additional Contact Form configuration necessary _specific to Mailgun_.
August Miller
CC BY-SA 4.0
2018-06-12T13:58:47.280Z
Hey, I have set the Contact Form preferences in the Control Panel (basically my email address). Regarding the Mailgun settings, I'm using the sandbox domain for testing (I made sure to whitelist my email address). Also in Mailgun's logs, the test emails are "accepted" and "delivered" properly to my email address. But when I try to submit a form through the contact form in Craft, nothing appears in the logs. As if there was no bridge between Mailgun and Contact Form.
Nicolas Barse
CC BY-SA 4.0
2018-06-12T16:49:10.480Z
This would suggest that the submission isn't making it past validation. Can you add the additional recommended error output code from [this section](https://github.com/craftcms/contact-form#displaying-flash-messages) of the docs? This may produce a useful message about why the submission is failing—I couldn't find how the error macro receives its data, so that may be an incorrect carry-over from the Craft 2 documentation…
August Miller
CC BY-SA 4.0
2018-06-08T16:20:45.837Z
2018-06-08T16:20:45.837Z
August Miller
<p>I'm developing my first website on Craft 3 and I'm essentially a front-end designer so my PHP/MySQL/AJAX knowledge is extremely limited.</p>

<p>I installed the Contact Form plugin as explained here <a href="https://github.com/craftcms/contact-form" rel="nofollow noreferrer">https://github.com/craftcms/contact-form</a> and used the code example on the page (minus the redirectInput).</p>

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

    {% from _self import errorList %}

    &lt;form method="post" action="" accept-charset="UTF-8"&gt;
        {{ csrfInput() }}
        &lt;input type="hidden" name="action" value="contact-form/send"&gt;
        {{ redirectInput('contact/thanks') }}

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

        &lt;h3&gt;&lt;label for="from-email"&gt;Your Email&lt;/label&gt;&lt;/h3&gt;
        &lt;input id="from-email" type="email" name="fromEmail" value="{{ message.fromEmail ?? '' }}"&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="{{ message.subject ?? '' }}"&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;{{ message.message ?? '' }}&lt;/textarea&gt;
        {{ message is defined and message ? errorList(message.getErrors('message')) }}

        &lt;input type="submit" value="Send"&gt;
    &lt;/form&gt;
</code></pre>

<p>But when I submit my form, the page reloads then zwoooosh, nothing happens! I can't tell if I'm not receiving the email or if it's not even being sent. I checked pretty much everywhere for similar issues but can't tell what's happening or not happening.</p>

<p>I didn't install any mail server on Ubuntu, I don't even know if that is necessary. I checked my Spam folder... I'm a bit lost at this point!</p>

<p>Any help would... help!</p>

<craft3><emails><plugin-contactform>
Contact Form Plugin - Not sending/receiving emails?
# Contact Form Plugin - Not sending/receiving emails?

(Asked by: username_0 on 2018-06-08)

I'm developing my first website on Craft 3 and I'm essentially a front-end designer so my PHP/MySQL/AJAX knowledge is extremely limited.
I installed the Contact Form plugin as explained here https://github.com/craftcms/contact-form and used the code example on the page (minus the redirectInput).
        {% macro errorList(errors) %}
        {% if errors %}
            
                {% for error in errors %}
                    {{ error }}
                {% endfor %}
            
        {% endif %}
    {% endmacro %}

    {% from _self import errorList %}

    
        {{ csrfInput() }}
        
        {{ redirectInput('contact/thanks') }}

        Your Name
        
        {{ message is defined and message ? errorList(message.getErrors('fromName')) }}

        Your Email
        
        {{ message is defined and message ? errorList(message.getErrors('fromEmail')) }}

        Subject
        
        {{ message is defined and message ? errorList(message.getErrors('subject')) }}

        Message
        {{ message.message ?? '' }}
        {{ message is defined and message ? errorList(message.getErrors('message')) }}

        
    

But when I submit my form, the page reloads then zwoooosh, nothing happens! I can't tell if I'm not receiving the email or if it's not even being sent. I checked pretty much everywhere for similar issues but can't tell what's happening or not happening.
I didn't install any mail server on Ubuntu, I don't even know if that is necessary. I checked my Spam folder... I'm a bit lost at this point!
Any help would... help!

**Tags:** craft3, emails, plugin-contactform

---

## 1 answers

### Answer by username_1 on 2018-06-08. Score: 1

Welcome to Craft!

You mention you haven't configured any kind of mail server—this is almost certainly the issue.

There are a few mailer adapters for Craft, the availability of which will depend on whether you're using Craft 2 or Craft 3.

That said, the easiest route will probably be to use the built-in SMTP method, configured in the `Settings -> Email` screen of the Admin.

I'd recommend checking out [Mailgun](https://mailgun.com) or [Sendgrid](http://sendgrid.com) as third-party services that handle mail delivery—this way, you're not responsible for maintaining your own mail server. Both offer generous free tiers that should cover most use cases.

Each should provide you with some SMTP credentials you can drop into Craft's settings.

Be aware: some ISPs will block SMTP traffic over the standard port. If you still have trouble sending mail, look at the docs for your chosen provider and see if they support sending over an alternate port.

Good luck!

> **Comments:**
> **username_2**: Probably worth mentioning as well: https://craftcms.com/support/troubleshooting-email-errors  
> **username_1**: Hadn't seen this before! Thanks, @BradBell!  
> **username_0**: Hey @AugustMiller thanks a lot for your suggestions. I made an account on Mailgun and managed to use a Mailgun plugin for Craft 3 to set up the API key interaction in the settings. The "test" email is working fine however I'm not sure how to make it interact with the plugin "Contact Form" or how to make write my contact form now that the email settings seem to be working. Any advice om this? Thanks!  
> **username_1**: Just to confirm—have you set the required Contact Form preferences in the Control panel or via a config file? https://github.com/craftcms/contact-form#overriding-plugin-settings  
> **username_1**: Internally, the Contact Form plugin uses Craft's mailer service, which acts as a bridge between any calls to send mail and the provider itself—this is just to say that there shouldn't be any additional Contact Form configuration necessary _specific to Mailgun_.  
> **username_0**: Hey, I have set the Contact Form preferences in the Control Panel (basically my email address). Regarding the Mailgun settings, I'm using the sandbox domain for testing (I made sure to whitelist my email address). Also in Mailgun's logs, the test emails are "accepted" and "delivered" properly to my email address. But when I try to submit a form through the contact form in Craft, nothing appears in the logs. As if there was no bridge between Mailgun and Contact Form.  
> **username_1**: This would suggest that the submission isn't making it past validation. Can you add the additional recommended error output code from [this section](https://github.com/craftcms/contact-form#displaying-flash-messages) of the docs? This may produce a useful message about why the submission is failing—I couldn't find how the error macro receives its data, so that may be an incorrect carry-over from the Craft 2 documentation…  

---

