I am getting bellow error while trying to send mail from drupal 9 SMTP mail. Please guide.
Error sending e-mail from admin@* to *@gmail.com: SMTP Error: Could not connect to SMTP host.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hi there,
Port 25, might be closed for some new accounts. What I would suggest instead is using port 587 or 465 rather than port 25.
Let me know how it goes!
Best,
Bobby
This does sound like your port is being blocked. What port are you using, is it 25 or 465/587? If you are using port 25 it’s most probably being blocked. Firstly, I’ll recommend using port 465/587 but if you must use port 25 I’ll recommend contacting the DigitalOcean’s support who will be more than happy to assist you with your account issue! :)
Hope that helps! - KFSys.
Hello there,
As already mentioned this error might be related to the settings you’re using. Google’s SMTP server does not use port 25 and so you’ll need to set either port 465 or 587.
We have an article on How To Use Google’s SMTP Server which you can check here:
https://www.digitalocean.com/community/tutorials/how-to-use-google-s-smtp-server
Regards
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.