getgrav / grav-premium-issues

Official Grav Premium Issues repository to report problems or ask questions regarding the Premium products offered.
https://getgrav.org/premium
7 stars 2 forks source link

Pls help with contact form setup, doesn't send #403

Closed EvgenyADE closed 8 months ago

EvgenyADE commented 9 months ago

1) I've set up a form on a page: https://old.parts/contacts#contact-us 2) set up "email' pligin with data from my provider

But it diesn't send a mail from a contact form.

Files are attached. contact.md

email.zip

rhukster commented 9 months ago

I relaly don't see any major issues with your contact form. Really the only thing I would say is that you should have a reply_to:. This way when you receive the email, you can click reply and it will automatically fill the user's email address. Currently you are not including the email address provided in the form in your email:

            from: {mail: "{{ config.plugins.email.from }}", name: "{{ config.plugins.email.from_name }}"}
            reply_to: {mail: "{{ form.value.email }}", name: "{{ form.value.name|e }}"}
            to: {mail: "{{ config.plugins.email.to }}", name: "{{ config.plugins.email.from_name }}"}

This also uses the new mail/name format also.

Other than that it's suprising that your SMTP configuration in the email.yaml uses regular non-HTTPS, port 25. But other than that, it looks OK, but i can't test it as you've removed the password.

I strongly suggest testing the mail sending with the bin/plugin email test-email CLI command. This will send a test message via your configuration. If this comes back with an error you should be able to debug from there. Most likely the username/password is incorrect, or that port 25 is being blocked (this is often the case, as unsecured port 25 often blocked due to huge spam issues if it's exposed.

EvgenyADE commented 9 months ago

Hi Andy,

You were right: I didn't have rights to send main from forms. So I've asked the support to allow.

Now I have the following reply:

/home/c/ca78697/pico/public_html/bin/plugin email test-email FATAL: Must be run from ROOT directory of Grav!

EvgenyADE commented 9 months ago

however, it works now!!! thank you!