Gmail addresses not working in formlt email field

I get this error when I type in a gmail address in the contact form.
If I type in my server email, it works ok.
My server host is shared, and is Krystal hosting.

[2022-12-28 15:57:02] (ERROR @ /home/wemysswe/public_html/core/components/formit/src/FormIt/Hook/Email.php : 325) [FormIt] An error occurred while trying to send the email. SMTP Error: data not accepted.SMTP server error: DATA END command failed Detail: sorry, you do not have permission to send email from gmail.com
 SMTP code: 550

Thinking it might be good to use an ESP for emails?

I think your form is defaulting to send the emails from your email field.

If you specify emailFrom in your formit call - this should override the default behaviour:

[[!FormIt?
    ...
    &emailFrom=`email@yourdomain.com`
    ...
]]
1 Like

Thanks for the quick reply.
It works, but how do I send comformation email?
Do you know why this is the default behavour?

If you still want to send an email to the person filling out the form - I think you’d use the FormItAutoResponder hook.

I suppose back in the days before SPF records and other email sender authentication technologies - it was just a nice way to show the person receiving the notification email who the for response had come from.

It seems to me that, nowadays, this setup will rarely work satisfactorily.

I think the emailsender system setting would be a better default now - but it is currently only used if no “email” field is found in the form.

Would be really helpful if you would show your code – formit call and form html. Also the modx version you’re using.

Here’s a recent post linking to the modx docs for setting up smtp mail sending on your site:

As far as I know, it’s no longer possible to use a gmail address as the From email in the form.

This topic was automatically closed 2 days after discussion ended and a solution was marked. New replies are no longer allowed. You can open a new topic by clicking the link icon below the original post or solution and selecting “+ New Topic”.