# Not receiving email from form

**URL:** <https://discourse.getcockpit.com/t/not-receiving-email-from-form/243>\
**Category:** Support\
**Created:** [September 3, 2018, 2:01pm UTC](https://discourse.getcockpit.com/t/not-receiving-email-from-form/243 "2018-09-03T14:01:14Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jesperlandberg](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.getcockpit.com/jesperlandberg/32/60_2.png) [@jesperlandberg](https://discourse.getcockpit.com/u/jesperlandberg)\
**Post date:** [September 3, 2018, 2:01pm UTC](https://discourse.getcockpit.com/t/not-receiving-email-from-form/243/1 "2018-09-03T14:01:14Z")

</div>

Hi,  
I have a form, which seems to be working fine, I can see the entries in the cms. However, I don’t get any emails even tho the option is checked. Any idea what that can be about? This is what the support at our hosting is saying:

> I have checked for you and found that emails has been sent properly from server  
> It seems that there is some issue at application end with authentication issue  
> It seems that there is no issue at server level, We suggest you to go for the plugins and authenticate it at application level.

But the front-end seems to be working since the entries are being posted to cockpit?

---

<div class="post-metadata">

**Author:** ![jesperlandberg](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.getcockpit.com/jesperlandberg/32/60_2.png) [@jesperlandberg](https://discourse.getcockpit.com/u/jesperlandberg)\
**Post date:** [September 7, 2018, 7:56am UTC](https://discourse.getcockpit.com/t/not-receiving-email-from-form/243/2 "2018-09-07T07:56:33Z")

</div>

Can anyone help me? Bump.

---

<div class="post-metadata">

**Author:** ![raffaelj](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.getcockpit.com/raffaelj/32/331_2.png) [@raffaelj](https://discourse.getcockpit.com/u/raffaelj)\
**Post date:** [September 7, 2018, 8:27am UTC](https://discourse.getcockpit.com/t/not-receiving-email-from-form/243/3 "2018-09-07T08:27:46Z")

</div>

Did you configure your SMTP options? If not:

You have to add a mail address in your form settings to receive mails and you have to setup your SMTP configuration in config/config.yaml, too. Otherwise Cockpit doesn’t know, how to send mails.

Adjust the settings to your needs.

```auto
# use smtp to send emails
mailer:
    from : contactform@example.com
    from_name : MyApp
    transport : smtp
    host : smtphost.provider.com
    user : fancy-username
    password : SuperSavePassword
    port : 587
    auth : true
    encryption: starttls

```

---

<div class="post-metadata">

**Author:** ![jesperlandberg](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.getcockpit.com/jesperlandberg/32/60_2.png) [@jesperlandberg](https://discourse.getcockpit.com/u/jesperlandberg)\
**Post date:** [September 7, 2018, 10:39am UTC](https://discourse.getcockpit.com/t/not-receiving-email-from-form/243/4 "2018-09-07T10:39:45Z")

</div>

Hi,

that works:) thank u!

However, message is empty and no subject, do u know how I can get the entry data to be sent as the message? And how to set a subject.

---

<div class="post-metadata">

**Author:** ![raffaelj](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.getcockpit.com/raffaelj/32/331_2.png) [@raffaelj](https://discourse.getcockpit.com/u/raffaelj)\
**Post date:** [September 7, 2018, 11:12am UTC](https://discourse.getcockpit.com/t/not-receiving-email-from-form/243/5 "2018-09-07T11:12:16Z")

</div>

The subject is empty because of a small bug. I fixed it [here](https://github.com/agentejo/cockpit/commit/ce7d261de6f53d7b040dca14020ea4c136a2b4be), but it’s a test repo. The forms need a better option to pass mailer options.

The default is, that all entries are sent via mail. They should be there. But you can define a html template in `config/forms/emails/formname.php` to create a nice looking message.

Did you use the right format for the form data? It should be something like `{"form":{"name":"rj","message":"test"}}`.
