Comments (9)
This is NOT a PHPMailer problem, it is related to either how you have configured SSL and/or TLS.
It may be related to the certificates you are using, and/or the config on the SMTP server.
Also, please note that you are providing the LEAST secure SSL option, which is not recommended.
Please, when done testing, revert to
'verify_peer' => true, 'verify_peer_name' => true, 'allow_self_signed' => false
from phpmailer.
And please, from the README file:
and before you ask a question about "SMTP Error: Could not connect to SMTP host.", read the troubleshooting guide (https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting).
from phpmailer.
You have two problems here. Your mail server is misconfigured – while offering a submission service on port 587, it lacks support for STARTTLS, which is an RFC contravention. The second issue is that it supports only GSSAPI and NTLM authentication, neither of which PHPMailer supports. They are largely obsolete; very old versions of PHPMailer used to have NTLM support, but it was dropped years ago.
Separately from these issues, this server is insecure because it advertises authentication methods without requiring encryption first, and these authentication schemes are not considered secure over unencrypted channels.
In short, you need a better mail server.
As @XL-2000 said, don't disable certificate validation. Here it's irrelevant because the server doesn't provide certificates anyway, but you shouldn't be doing it anyway.
from phpmailer.
I started by defaulting to not disabling the certificate, and got the same result:
SMTP Error: Could not connect to SMTP host. STARTTLS command failed Unrecognized command 'STARTTLS'
Change the parameters to this: 'verify_peer' => true, 'verify_peer_name' => true, 'allow_self_signed' => false and the result is the same.
from phpmailer.
The same code could be sent normally before.
But a few days ago, it suddenly stopped working. Because the SMTP for email is provided by the customer, we have no way to set it up. However, the customer reported that using asp.net, the SMTP service can be used to send emails normally.
from phpmailer.
Yes, that's why I said the ssl settings were irrelevant – you have no encryption, so there is no certificate to verify, so changing verification settings won't make any difference.
If you don't change anything in your script, then the mail server must have changed. It would not surprise me if it's an obsolete server; it's really common for MS servers to be many years out of date, and a patch update can break things.
asp.net is a proprietary Microsoft product and as such provides support for proprietary Microsoft protocols like GSSAPI and NTLM. If you need to maintain compatibility with them, switch to asp.net; you're not going to get support for them here.
from phpmailer.
Is it necessary to configure the mail server certificate to deal with this problem?
How should I describe how to fix this smtp service?
So how else can I use the smtp service to send emails?
from phpmailer.
Yes, you need to ask them to do these things:
- Enable encryption (STARTTLS on port 587 and SMTPS on port 465)
- Require encryption before authentication (that they are not doing this already is a bad sign)
- Enable support for standard
LOGIN
and/orPLAIN
authentication schemes
from phpmailer.
OK, thank you very much for your answer
Yes, you need to ask them to do these things:
- Enable encryption (STARTTLS on port 587 and SMTPS on port 465)
- Require encryption before authentication (that they are not doing this already is a bad sign)
- Enable support for standard
LOGIN
and/orPLAIN
authentication schemes
from phpmailer.
Related Issues (20)
- addBCC doesn't work without AddAddress HOT 10
- "Invalid address: (cc): " HOT 2
- Gmail
- hi i have problem- -function open ssl_pkey_free is depraced since php 8.0 HOT 2
- send differents body for mulitple bcc addresses in one send command HOT 4
- T
- Add the possibility of changing @phpmailer.0 string in asHtml method when composing image cid. HOT 2
- Missing header termination in multipart/mixed container HOT 2
- Issues with sending emails HOT 13
- 405 Not Allowed HOT 4
- SMTP Authentication not working with special characters like "§" HOT 1
- Withdraw/recall HOT 2
- edebug() should probably also get ride of "\r\n" when using LoggerInterface HOT 1
- postfix installation problem in PHP 5.5 test suite
- Not sending email when subject has first and last name in it HOT 7
- How do I only get the SMTP ERROR from debugging? HOT 1
- Can you add possibility to customized dsn by recipient ? HOT 4
- 6.2.0+ corrupts HTML body HOT 5
- DKIM failes when I add an AltBody HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from phpmailer.