Free gmail accounts not working witt default PHPMailer

Hi all -

I’m using kirby’s default email function as shown here for a simple contact form. It works if I define both the to and from addresses as addresses I use with GSuite, but if I make them my personal address which is just an @gmail.com address it never works. Does anyone know why that would be? I’m not totally clued up with what’s happening under the hood here and thinking maybe free gmail doesn’t support something that’s required. Thanks

Do you actually get an error message from the try/catch block or is the email sent but just never arrives?

It’s sent but never actually arrives, checked spam etc etc, nothing.

Hm, in general it is never a good idea to use personal email for testing such stuff, because it can easily get blacklisted.

Are you testing locally? Then try installing mailhog to see if the mail is actually sent.

Thanks for the reply. It was live and working fine for around a year and I’ve been notified it stopped working and have checked and so it has. Nothing has changed on server AFAIK. Works if i change to gsuite address, but not if i use a free gmail one. When you say it can get blacklisted, are you able to elaborate at all? I thought that would only be the case if you were using that mail server.

Not a mail expert, but I actually ran into this problem with mail not arriving with my private email address when testing stuff locally, or only hours or days later suddenly.

On my Mac I then logged the smtp stream which told me about this blacklisting stuff…

Thanks, hmmm. Well I’ve just tested the website domain and it is blacklisted on a single list - I’m not sure how much that affects things, but still not sure why that would affect receiving it at a personal gmail and not a gsuite one.

Ok, I think I misunderstood, I though this was about the sender, not the receiver.

So if you use the same sender, the mail arrives when sending to a GSuite address, but not to a gmail account?

But even that wouldn’t be surprising because it depends on the spam filters used.

Thanks, yeah i was thinking of spam filters, but spam filters only affect the email once it’s arrived right? If I search for the exact subject i cannot find it anywhere and if its not in the spam box where else would it be?

That could depend on spam filter settings, if stuff is rated bad enough, it’s probably blocked and not even let through into the spam box.

Thanks. I can’t really see an ‘allow’ option in gmail to override that though, just options to safely label things OUT of spam. The mystery continues…

Well, maybe someone else comes up with better insights…

Thanks I appreciate the help, just a real tricky one. I’ve tried replacing with the uniform plugin, but am having the same options (the idea being at least with uniform I can log it all). Must be said I am using Kirby 2 for a few reasons, but at this point in time I can’t upgrade this site to v3. The site is hosted on digital ocean (via Cloudways). Interestingly I found the below in a digital ocean forum regarding sendmail. Is sendmail what the Uniform for Kirby 2 plugin uses?

From your description it looks like you are trying to send an email to yourself (where the sender From and recipient To of the email are the same).

If this is the case: Try using a different From address for testing. Gmail has a specific “feature” that sends all email coming from your own email address into a black hole. That’s probably to prevent infinite forwarding, but it can cause unexpected issues like this one.