Hi everybody,
My name is Michel, I 'm a new projeqtor user. [url= https://Hi everybody, My name is Michel, I 'm a new projeqtor user. We use it in our firm to follow some projetcs. Since sevrals weeks, we're not able to send mails from projeqtor. May be the migration from exchange to 365 is the cause. I've an error: "SMTP connect() failed https://github.com/PHPMailer/wiki/Toubleshootin g" Is someone could help me please?]link to the error[/url]
We use it in our firm to follow some projetcs.
Since sevrals weeks, we're not able to send mails from projeqtor.
May be the migration from exchange to 365 is the cause.
I've an error: "SMTP connect() failed
https://github.com/PHPMailer/wiki/Toubleshootin g"
Is someone could help me please?
Hello
There could be several reasons for this message, this error means that PHPMailer failed to establish a connection with the SMTP server.
it could be an incorrect SMTP configuration, a firewall or hosting provider blocking, SSL/TLS certificate issue, suspended SMTP account or incorrect authentication or using an incorrect port... we can't do anything for you about that
Thank you for that reply.
Have a nice day.
Hi @Mitch, I had the same problem and found the cause was SMTP server variables defined in .../files/config/parameters.php were overriding my changes made in the web config. Commenting out the values solved my problem. The clue for me was the SMTP values I had entered and believed saved had changed when I navigated to a different menu selection and then back to the SMTP settings ([Configuration > Global parameters > Mailing > Emailing]).
Commented lines in .../files/config/parameters.php:
// defining here will override values from db (i.e. will override SMTP config changes made in ProjeQtOr web interface)
//$paramMailSmtpServer = 'localhost';
//$paramMailSmtpPort = '25';
//$paramMailSendmailPath = '';
This also happened to be Issue #6 in the troubleshooting guide ChatGPT created for me:
Troubleshoot “SMTP connect() failed”
The error “SMTP connect() failed” from PHPMailer (which ProjeQtOr uses for sending emails) means the app couldn't establish a connection with the SMTP server. It’s a common issue and usually fixable with some focused troubleshooting.
Here’s how to go about it, step by step:
1. Check SMTP Server Details
Make sure:
- SMTP host is correct (e.g., smtp.gmail.com, smtp.office365.com)
- Port is correct (587: STARTTLS, 465: SSL, 25: Non-encrypted and sometimes blocked by ISPs)
- SMTP username/password are valid and current
If you're using Gmail, you may need to use an App Password instead of your regular password (if 2FA is on).
2. Verify Encryption SettingsSet the encryption to match the SMTP server’s requirements:
- PHPMailer::ENCRYPTION_STARTTLS: Port 587
- PHPMailer::ENCRYPTION_SMTPS: Port 465
Mismatch = failure to connect.
3. Check for firewall or network blocking
Sometimes servers block outbound connections on SMTP ports.Check that:
- Outgoing traffic on port 587/465 is not blocked by a firewall
- Your hosting provider or sysadmin allows SMTP traffic
Use tools like telnet or openssl from the server:
telnet smtp.gmail.com 587
or
openssl s_client -connect smtp.gmail.com:465
If it fails here, it’s not a PHP/ProjeQtOr issue—it’s a network problem.
4. Enable Debugging in PHPMailer
You can enable debugging to get more info:
$mail->SMTPDebug = 2; // Or 3 for more detail
In ProjeQtOr, this may involve editing parameters.php or enabling verbose logging temporarily to capture the PHPMailer output.
5. Check PHP EnvironmentEnsure these PHP extensions are enabled:
openssl: required for secure connections
php-sockets
php-curl (sometimes used)
php-imap: required for ProjeQtOr to retrieve emails via IMAP
To check: e.g. “$ php -m | grep openssl”
6. Check for Hardcoded Configs
If you’re editing SMTP settings through the web interface, make sure parameters.php doesn’t override them. Sometimes the file has fixed values that prevent changes from taking effect.
7. Review PHPMailer's Wiki
PHPMailer's official troubleshooting page has lots of extra detail.
PHPMailer Troubleshooting Guide https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting
8. Special Cases
Gmail
- Enable "Less secure apps" (or use App Passwords if 2FA is enabled)
- Make sure your account isn’t being blocked for suspicious sign-ins
Office 365
- Must use SMTP Auth, TLS, and login credentials
- Sometimes requires admin permissions to send via SMTP
9. Common Pitfalls
- Wrong port: Match encryption type (TLS/SSL)
- Wrong host: Confirm hostname/IP of SMTP server
- Firewall blocking ports: Use telnet/openssl to test connection
- Invalid credentials: Confirm username and password (or App Password)
- PHP extensions missing: Make sure openssl and others are enabled