Configure SMF 2.0.19 and Office365 to send forum emails

Started by Jameson, July 15, 2025, 03:16:00 PM

Previous topic - Next topic

Jameson

Hello! We recently acquired a company who uses SMF as their forum platform. They were previously using SendGrid to send emails to forum members (activation emails, password resets, etc.) We honestly didn't even think about it at the time we transitioned the company, but we canceled the SendGrid account in favor of using Shopify emails for transactional communication.

After a couple weeks it dawned on me that we're not getting notifications because we hadn't updated the email provider. This morning I tried to set up SMF to use the SMTP server for Office365, which is what the company uses for email. We set up a new mailbox, provided it an Office365 license, and activated SMTP AUTH in the Exchange admin. We set up SMF to look at smtp(dot)office365(dot)com using port 587, we provided an SMTP username that is the entire email address, and we verified the password.

I then set up a relay in Exchange that uses our certificate as verification. None of this has worked.

Is there a step I'm missing in either Exchange or SMF to enable sending these emails? Has anyone had success getting this working?

Thanks! Jameson

Jameson

I'm actually thinking this is related to a SendGrid mod that was installed. I'm unclear on how to uninstall it given that there isn't a UI for it anywhere and doesn't show up in the packages list

Aleksi "Lex" Kilpinen

Try tls://smtp.office365.com

You can use ssl:// or tls:// to tell SMF what the server expects.
Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF

Jameson

Thanks for that suggestion. Unfortunately neither tls:// nor ssl:// worked. I can't tell if this is because of the sendgrid-php package that was previously installed or if it's a Microsoft problem (or the third and most likely option - I'm not doing something correctly).

I'm happy to re-try SendGrid to get things running again, but I'm honestly not even sure how to edit the API key or change any of the settings. I tried reviewing the documentation but it's beyond my comprehension.

francoisdb

You shouldn't set SMTP office365(dot)com, but smtp(dot)domainname(dot)xx. This is the domain name from which the emails should be sent.
note
xx stands for the domain name extension

Office365 is Microsoft's client email software, where you have to log in with Microsoft Mail (Hotmail/Outlook) to read and send your emails.
However, there's a bug not only in 2.1.16 but also in 2.0.19 that prevents emails from being sent from the SMF forum. Also read my topic.
https://www.simplemachines.org/community/index.php?topic=592299.0
About Sendgrid. It's an SMF Mod that, in my opinion, hasn't been updated to the latest SMF version yet.
https://custom.simplemachines.org/index.php?mod=4357

Aleksi "Lex" Kilpinen

#5
francoisdb just stop.

https://learn.microsoft.com/en-us/exchange/mail-flow-best-practices/how-to-set-up-a-multifunction-device-or-application-to-send-email-using-microsoft-365-or-office-365#set-up-client-smtp-submission

One more nonsense post from you, and you will be moderated.
The Office365 address is smtp.office365.com. The bug you mentioned does not exist in 2.0 as far as I'm aware. And the OP has actually already posted in the Sendgrid mod topic you linked to.

Quote from: Jameson on July 15, 2025, 03:16:00 PMIs there a step I'm missing in either Exchange or SMF to enable sending these emails? Has anyone had success getting this working?
Just now came to think of this, you might want to check that the account you are using for SMTP matches the address configured as your Webmaster email address in SMF, as SMF will try to use your webmaster email as the sender and reply-to address of any outgoing emails. And M$ might not like that, and may filter it as spam, if it doesn't match the account used.
Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF

prdx

I think first of all you should test if office365 is allowing you to send e-mail using an especific account and if it works then configure it in the forum. And maybe, as you say, you need to get rid of any other mod that may affect you.

If you have access to a linux box I highly recommend you testing with swaks (the swiss army knife of mail).
For instance, to test sending email using office365 smpt would be:

Code (shell) Select
swaks \
  --to [email protected] \
  --from [email protected] \
  --server smtp.office365.com \
  --port 587 \
  --auth LOGIN \
  --auth-user [email protected] \
  --auth-password 'your password' \
  --tls \
  --header "Subject: Tests with Swaks" \
  --body "Test Swaks email via Office365."

If this works it's just see how to congigure it in smf admin settings.
I am not under any orders to make the world a better place.

Advertisement: