Skip to content
Grav 2.0 is officially stable. Read the announcement →
General

No email sent by contact form

Solved by Karmalakas View solution

Started by Greg 4 years ago · 8 replies · 672 views
4 years ago

The issues I had with a contact form have not been sorted out. The contact form now "works" in that there is no error and it displays the Thankyou message.

However emails are not being sent or received. I assume the problem is in the Email Plugin SMTP setup.

This is the email.yaml in config. I have hashed out the password and email user.
I would appreciate any tips on what is blocking the email action. I have tried both SSL and TLS, neither work.
Thanks in advance.

YAML
enabled: true
from: ######@gmwit.com
from_name: null
to: ######@gmwit.com
to_name: MurrayG
queue:
  enabled: true
  flush_frequency: '* * * * *'
  flush_msg_limit: 10
  flush_time_limit: 100
mailer:
  engine: smtp
  smtp:
    server: mail.gmwit.com
    port: 465
    encryption: tls
    user: #######@gmwit.com
    password: #######
    auth_mode: null
  sendmail:
    bin: '/usr/sbin/sendmail -bs'
content_type: text/html
debug: true
charset: null
cc: null
cc_name: null
bcc: null
reply_to: null
reply_to_name: null
body: null
last edited 03/30/22 by pamtbaau
4 years ago

I think for TLS port on SMTP should be 587
Or you could contact your hosting provider and ask for details

4 years ago

Hi, the info from my cpanel is

YAML
Username:   the email address
Password:   Use the email account’s password.
Incoming Server:    mail.gmwit.com
IMAP Port: 993 POP3 Port: 995 

Outgoing Server:    mail.gmwit.com
SMTP Port: 465 

IMAP, POP3, and SMTP require authentication.

I have now tried 2525 (non secure. And 465, 995.......

4 years ago

Then try changing encryption to none (not sure about the correct value in config though; Might be null)

4 years ago

@MurrayG, The following works fine with my provider:

YAML
port: 465
  encryption: ssl
4 years ago

Yep, that work everywhere but on this email form :crazy_face:
Can this be a que issue or something else in the yaml
just to be sure I am posting the new form data.

YAML
title: 'Contact Form'
form:
    name: contact
    fields:
        name:
            label: Name
            placeholder: 'Enter your name'
            autocomplete: 'on'
            type: text
            validate:
                required: true
        email:
            label: Email
            placeholder: 'Enter your email address'
            type: email
            validate:
                required: true
        message:
            label: Message
            placeholder: 'Enter your message'
            type: textarea
            validate:
                required: true
    buttons:
        submit:
            type: submit
            value: Submit
        reset:
            type: reset
            value: Reset
    process:
        save:
            fileprefix: contact-
            dateformat: Ymd-His-u
            extension: txt
            body: '{% include ''forms/data.txt.twig'' %}'
        email:
            subject: '[Site Contact Form] {{ form.value.name|e }}'
            body: '{% include ''forms/data.html.twig'' %}'
        message: 'Thank you for getting in touch!'
        display: thankyou
4 years ago Solution

Did you try without the queue? Does it work if email is sent directly on submit?

4 years ago

Hi Folks. OK, I dont really understand why but its working.
I turned off que and debug.
However, can I ask the following
1 How do I remove this from above the Thankyou message
title: Email sent cache_enable: false process: twig: true

2 how can I restrict the width of the form, ATM its full width...
I will put the sidebar att the end of the form markdown, anything else?
please keep it "simple" I am a learnatic :)

4 years ago

@MurrayG,

I believe your original question has been solved. It is a good practice to only have one question with a matching title in each post. The email issue has been fixed.

You can open a new post for a new question.

👍 1
last edited 03/30/22 by pamtbaau

Suggested topics

Topic Participants Replies Views Activity
General · by Jerry Hunt, 4 days ago
2 129 21 hours ago
General · by pamtbaau, 1 day ago
1 90 1 day ago
General · by Andy Miller, 2 days ago
0 74 2 days ago
General · by Marcel, 12 months ago
6 384 5 days ago
General · by Duc , 6 days ago
3 70 6 days ago