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

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

Content & Markdown

Form submission from email 'from' field taken from the form. Doesnt work for gmail

first-time form

Solved by pamtbaau View solution

Started by Graham 2 years ago · 3 replies · 467 views
2 years ago

Im trying to get what is input by the user as the 'from' field so when I receive the email I can simply reply. I have it working as below:

TWIG
        email:
            from: '{{ form.value.email|e }}'
            to: '{{ config.plugins.email.to }}'
            subject: 'MyForm - {{ form.value.name|e }}'
            body: '{% include ''forms/data.html.twig'' %}'

However, when I try this with a @googlemail.com email I get "Expected response code "250" but got code "550", with message "550 sorry, you do not have permission to send email from googlemail.com"."

email plugin is setup and working,if I put in a made up email [email protected], for instance, I receive the email and can reply.

Ive searched loads and cant seem to find anything relating to this so I can only assume I am doing something wrong as it doesnt seem to be an issue for others.

2 years ago Solution

@Grayches:
Expected response code “250” but got code “550”, with message “550 sorry, you do not have permission to send email from googlemail.com

This is not an error generated by Grav. You will probably have more luck searching the web and/or asking your mail provider.

2 years ago

I should have thought of this, thank-you.
I wondered how this can be the case as phpmailer on my current site works... it doesnt for googlemail com, I just tried it after your replay. Krystal hosting are blocking it. Thanks again.

2 years ago

From the docs

TWIG
reply_to: "{{ form.value.name|e }} <{{ form.value.email }}>"

Suggested topics

Topic Participants Replies Views Activity
Content & Markdown · by Jochen, 8 months ago
6 96 8 months ago
Content & Markdown · by Ton Haarmans, 1 year ago
10 184 1 year ago
Content & Markdown · by Jan L'Am, 1 year ago
4 147 1 year ago
Content & Markdown · by Leonardo, 1 year ago
3 61 1 year ago
Content & Markdown · by belthasar, 1 year ago
4 255 1 year ago