SMTP Mail through G Suite

Greetings Gibbon!

I’m trying to use our organization G Suite service to route SMTP mail through our Gibbon instance, but I’m not finding support articles to help me through the process. I will keep digging, but I wanted to see if you all had any additional guidance.

To be clear, we aren’t interested in using the single sign on integration. I want to route Gibbon emails through our G Suite email services.

Help is appreciated as always!
Kevin

Hi Kevin,

If you head to Admin > System Admin > Third-Party Settings you’ll see a section on SMTP. The settings you need there can be found in the following Google support guide:

https://support.google.com/a/answer/2956491?hl=en

Sadly, Gibbon’s documentation is not up to the standard set by Google…but I’m sure we’ll get there one day!

Cheers,

Ross

Hi Kevin, one of our lovely community members must have seen this post, and has created some documentation to help you out:

https://docs.gibbonedu.org/administrators/misc/smtp-email/

Thanks to Jack for this!

Cheers,

Ross

Thank you, Ross, and thank you to Jack too! I haven’t had any luck quite yet–I get a variety of errors when I try to send the test email (depending on my settings), but this one seems to indicate I am close.

An error (SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting) occurred sending an email to kcleary@ironhorsemusic.org.

I’ll keep fussing with it, but if anyone has good ideas I would be happy to give the a try!
Kevin

Hi Kevin, it all has to be enabled on the Google side, in your Domain Admin, if that helps. Ross.

If it helps, I had the same issue when I first tried to set it up. It really helped me to look at my PHP error logs, to see what the issue was. For me, it seemed to be legacy authentication wasn’t enabled in Microsoft Admin, however, this will be different for you in GSuite.

I got it enabled on the G Suite side (at least according to the Google instructions), so I think it’s something on the server side. I tried opening up the 587 port on ufw in case that was an obstacle, but no luck. I started some php digging and found articles suggesting a need to use phpmailer, but that’s when I hit a wall.

I will see what I can do on the php error log side and keep digging into G Suite settings that might be off. I am happy to peruse any other help materials either of you find.

Thanks!
Kevin

Here is what Google suggests:

  1. Turn on less secure apps in the Admin console.
  2. Turn on less secure apps in te account being used.
  3. Create and use app-specific passwords to use with the device or service that is sending email.

The Google SMTP host is: smtp.gmail.com. Use port 587 when using TLS (select this in Gibbon).

Enter the full email used to access Gmail, and the associated password, making sure less secure apps has been enabled.

If this doesn’t work, I suggest taking a look at your PHP error logs, typically found in Linux distributions at /var/log/apache2/error.log (however this may vary).

Best,
Jack

Hi Kevin, in addition, if you are using a dedicated account for this (smtp@…) make sure you’ve logged into it at least once, otherwise I am not sure it’ll work.

Behind the scenes Gibbon uses phpmailer, so don’t worry about that: it’s been widely used and tested, and we know it works 99 times out of 100…and in general when it doesn’t it is a config issue rather than a coding issue.

Keep digging!

Your three steps got it working, Jack–thank you so much! That all makes sense now that I’ve got it in place, but I don’t think I would have made it without guidance. I had step one all set, but turning off less secure apps for a single account was not intuitive at all. (And it took some additional experimenting to get the app password in place.)

I just send a test email, though, and it came through. Thanks again, Jack, and thank you Ross as well!
Kevin

Hi,
I am facing similar setup. I am using my personal gmail email id with 2 factor authentication enabled.
I cant used less secure apps option as Google no longer supports the use of third-party apps or devices which ask you to sign in to your Google Account using only your username and password.

In php logs I am getting error CLIENT → SERVER: [credentials hidden]
[12-Dec-2022 19:31:34 Asia/Kolkata] SERVER → CLIENT: 535-5.7.8 Username and Password not accepted.

Can you please help.

I am able to solve this. Initially app password was not working but after reconfiguring the same, problem got resolved.

1 Like

Hello again, Gibbon!

My smtp mail has been working well through G Suite (a true lifesaver in terms of time and effort to connect with students!), but I have noticed one small challenge.

Anytime I send an email to large numbers of people (70-80 seems to be the magic number, but I haven’t tested it carefully), I tend to get emails that fail to send. This can happen within a single message, but yesterday I ran into the problem with messages that got sent back to back. Is there a server setting I can check or adjust that might remove this obstacle?

Thank you for any thoughts you have. I love how well this is working, but appreciate the chance to tweak it.

Kevin

Hi Kevin, is your smtp relay going through an authenticated user in your Google Workspace? Be sure to check the Gmail sending limits based on how you’ve configured your mail settings.

Thank you, Sandra! This does seem to be an Google limitation for their smtp relay option. Now that I know, though, I am on the right track to finding a solution!

1 Like

This may not be the correct place for this question, but I’m going to start here.

With google retiring all password based access in June (OAuth will be required starting June 15), I will not be able to use smtp protocols currently enabled in Gibbon. Has anyone looked into this change or are there suggestions? I have come to rely on emailing through Gibbon and don’t want to lose that capability.

Thanks!
Kevin

Hi Kevin, yes we are currently looking into this and hope to have an alternate OAuth based mailing option in the core for v27 in April. We will aim to write some SMTP to OAuth migration instructions as well.

You have made my day–thank you so much, Sandra!
Kevin