Making email deliverable with SMTP / transport config / third party

Hi All,

I’ve set up a simple contact form and controller based on the basic recipe. It works, in that an attempt to send email is made and a “Success” message is shown. A dump($data); shows the right info after the Post.

However, I’m a little lost when it comes to actually getting the email delivered. The emails I tried bounce back to my account, saying “Mail delivery failed: returning message to sender”.

I’m not sure if I should be using a simple ‘transport configuration’ Sending emails | Kirby CMS and if so, where do I find an SMTP server? Is that a service I need to set up separately; or will my hosting account provide it?

Or, should I use a separate email provider like Mailgun as in: Email | Kirby CMS ?

Right now the site is in development and at a temporary domain – does that affect the deliverability? Does my “from” email need to match the domain? Maybe debugging this issue would be easier at the permanent domain, but I’d like to make sure I can get it to work before going live.

Thanks for any advice you can provide.

There can be multiple reasons why email deliverability fails. does the temporary domain have spf and skim dns records set? Failure to do so might be a reason the mail is rejected as spam.

No, it looks like it doesn’t. I guess I will wait till the site is at its real domain, and attempt to set up those records with this instruction from Google.

If I used something like Mailgun and this documentation would that bypass the need for these records?

Yes, see https://help.mailgun.com/hc/en-us/articles/360011565514-DNS-frequently-asked-questions#:~:text=While%20the%20two%20TXT%20records,adding%20the%20required%20TXT%20records. This applies to all services sending on your behalf

Thank you for your help! That Mailgun help article indicates you still need to set up SPF and DKIM records to verify a custom domain. But, in my case I was able to use a sandbox domain in Mailgun because I only want to send to myself, and you can do this as an “Authorized Recipient”. I used this email transport config: Email provider mailgun - #19 by mickaeldurand
Works!