Skip to content
● Meet Grav Guard: keep every Grav site you run secure and up to date, all from one place. Free for up to 3 sites. Read more →

Contact form on namecheap.com

plugins solved

Started by Alasdair 6 years ago · 0 replies · 4437 views
6 years ago

In case anyone else needs it, here's how to get a contact form working on namecheap shared hosting. I couldn't get mine to send using just SMTP from the Email plugin, or using Sendmail, but...

Set up an email address in namecheap cpanel -> emails

Contact namecheap support and ask them to open the SMTP ports, which are closed by default.

Install the Php mailer plugin from zip* via Admin -> Tools -> Direct install

Activate it and set:
Email from: [the email address you created]

Use these settings for the Email plugin:

Email Defaults

From address: [the email address you created]

SMTP Configuration

SMTP Server: cpanel server address - e.g server123.web-hosting.com
SMTP Port: 465
SMTP encryption: SSL
SMTP login name: [the email address you created]
SMTP password: [the password you used when you setup that mailbox]

Contact form

TWIG
process:
        - phpemail:
            # To visitor
            to: "{{ form.value.email }}"
            subject: "Thank you for getting in touch"
            body: "{% include 'forms/visitor.html.twig' %}"

        - phpemail:
            # To myself
            to: "{{ config.plugins.email.to }}"
            subject: "A message from your website from {{ form.value.name|e }}"
            body: "{% include 'forms/data.html.twig' %}"

Thanks to mickidum for this handy plugin.

* Is there a reason that it can't be found by searching plugins or installed via command line?

Suggested topics

Topic Participants Replies Views Activity
Installation & Hosting · by vollstock, 4 days ago
3 97 4 days ago
Installation & Hosting · by David, 7 years ago
3 3395 2 weeks ago
Installation & Hosting · by David Meissner, 3 weeks ago
3 248 2 weeks ago
Installation & Hosting · by David Meissner, 3 weeks ago
0 172 3 weeks ago
Installation & Hosting · by Anthony J Cervo, 4 weeks ago
3 237 3 weeks ago