Fixes
Email delivery
Mail that lands in spam or is rejected: SPF, DKIM and DMARC alignment, Gmail and Outlook sender rules, and the mail server behind them.

37 fixes
Problems in this area
37 of 37 fixes
- CodeIgniter email does not send and shows no error message
$email->send() returns false and nothing else happens4 causes - Django send_mail fails or hangs with an SSL error
send_mail() hangs while connecting to the SMTP server4 causes - DKIM shows 'bad version' or 'unknown key type' because the DNS key record is malformed
dkim=neutral (bad version)4 causes - SmtpException: Unable to read data from the transport connection (net_io_connectionclosed)
System.Net.Mail.SmtpException: Unable to read data from the transport connection: net_io_connectionclosed.4 causes - Dovecot refuses to start: Can't load SSL certificate, no valid PEM certificate
Can't load SSL certificate (ssl_cert setting): There is no valid PEM certificate3 causes - Mail from your own domain keeps landing in the spam folder
Messages from our own domain arrive in Gmail's spam folder5 causes - Exchange bounce: 550 5.1.10 Recipient not found by SMTP address lookup
550 5.1.10 RESOLVER.ADR.RecipientNotFound; Recipient not found by SMTP address lookup5 causes - Gmail rejects your mail with 550 5.7.26: no authentication information
550-5.7.26 This message does not have authentication information or fails to pass authentication checks4 causes - Gmail SMTP blocks you with 454 4.7.0 Too many login attempts
454 4.7.0 Too many login attempts, please try again later2 causes - Gmail rejects your mail with 530 5.5.1 Authentication Required
The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.5.1 Authentication Required3 causes - Gmail SMTP login fails with 535 or 534 5.7.14
535-5.7.8 Username and Password not accepted3 causes - Python IMAP OAuth login to a shared mailbox in Microsoft 365 fails
A01 NO AUTHENTICATE failed.4 causes - IONOS mail fails SPF because the record is missing, duplicated or too long
spf=fail or spf=softfail for a message sent through IONOS4 causes - Jakarta Mail throws MessagingException: Could not convert socket to TLS
jakarta.mail.MessagingException: Could not convert socket to TLS3 causes - Jakarta Mail cannot connect to smtp.gmail.com on port 465 (response: -1)
Could not connect to SMTP host: smtp.gmail.com, port: 465, response: -13 causes - Sending mail from Java fails with NoClassDefFoundError: javax/activation/DataSource
java.lang.NoClassDefFoundError: javax/activation/DataSource2 causes - Laravel tries to send mail to mailpit:1025 instead of your real SMTP server
Connection could not be established with host "mailpit:1025"3 causes - Laravel mail fails because an address does not comply with RFC 2822
Symfony\Component\Mime\Exception\RfcComplianceException: Email "" does not comply with addr-spec of RFC 2822.3 causes - Laravel says the email was sent, but nothing arrives
No exception is thrown and no email arrives3 causes - Laravel mail fails with 'Unable to connect with STARTTLS' and SSL operation failed with code 1
Unable to connect with STARTTLS: stream_socket_enable_crypto(): SSL operation failed with code 1.3 causes - Nodemailer login fails because Microsoft 365 has SMTP AUTH turned off
Invalid login: 535 5.7.139 Authentication unsuccessful, SmtpClientAuthentication is disabled for the Tenant3 causes - Outlook.com bounces your mail with 550 5.7.515
550 5.7.515 Access denied, sending domain example.com does not meet the required authentication level.4 causes - PHP mail() returns true but the email never arrives
Warning: mail(): "sendmail_from" not set in php.ini or custom "From:" header missing4 causes - PHPMailer addCC() adds no CC recipient
addCC() returns false3 causes - PHPMailer breaks on newer PHP because of __autoload() or PHPMailerAutoload.php
require 'PHPMailerAutoload.php' in code that worked on an old PHP version3 causes - PHPMailer cannot connect to the SMTP host (Gmail and others)
SMTP Error: Could not connect to SMTP host.6 causes - PHPMailer: the SMTP certificate does not match the host name you connect to
stream_socket_enable_crypto(): Peer certificate did not match expected3 causes - PHPMailer runs without an error, but no email arrives
No exception, no output, and no email3 causes - PHPMailer cannot connect to the SMTP host from a GoDaddy server
SMTP Error: Could not connect to SMTP host.2 causes - PHPMailer fails with 'certificate verify failed' when connecting to the SMTP server
Warning: stream_socket_enable_crypto(): SSL operation failed with code 1.3 causes - Postfix refuses to send with "Relay access denied"
554 5.7.1 <user@example.net>: Relay access denied5 causes - Python says module smtplib has no attribute SMTP
AttributeError: module 'smtplib' has no attribute 'SMTP'2 causes - SendGrid rejects your API key from Node.js
401 Unauthorized3 causes - 5.7.57 Client was not authenticated to send anonymous mail during MAIL FROM
5.7.57 SMTP; Client was not authenticated to send anonymous mail during MAIL FROM4 causes - Sending mail from Java fails with 530 5.7.0 Must issue a STARTTLS command first
SMTPSendFailedException: 530 5.7.0 Must issue a STARTTLS command first3 causes - Python smtplib raises SMTPServerDisconnected: please run connect() first
smtplib.SMTPServerDisconnected: please run connect() first3 causes - SpamAssassin adds SPF_HELO_NONE to mail sent from your Postfix server
SPF_HELO_NONE2 causes
Next step
Something here keeps breaking?
I fix these for clients and run the same stack in production myself.