If you want a mail client, a website form or a small script to send through a Yahoo Mail account, you need the right server name, port, security mode and credentials. Getting one of these wrong produces vague errors, and a surprising number of failures come from using the account password where Yahoo expects an app password. This guide lists the settings, explains each one and covers troubleshooting.
It also explains when a consumer mailbox is the wrong tool for the job, because applications that send customer mail need higher limits, authentication under your own domain and delivery data that a personal account cannot provide.
Settings can change. Confirm them against Yahoo's current help pages before you rely on them.
Outgoing (SMTP) settings
| Setting | Value | Notes |
|---|---|---|
| SMTP server | smtp.mail.yahoo.com | Outgoing mail host |
| Port with implicit TLS | 465 | Connection is encrypted from the start (SSL/TLS) |
| Port with STARTTLS | 587 | Connection starts in plain text and upgrades to TLS before login. See choosing ports |
| Authentication | Required | Use the login below |
| Username | Full address, for example [email protected] | Not just the part before the @ |
| Password | App password | Generate one in Account security |
| From address | Must match the authenticated account | Yahoo may rewrite or reject other senders |
Incoming settings (for reading mail)
| Protocol | Server | Port | Security |
|---|---|---|---|
| IMAP | imap.mail.yahoo.com | 993 | SSL/TLS |
| POP3 | pop.mail.yahoo.com | 995 | SSL/TLS |
SMTP only sends. To read mail in a client you also configure IMAP or POP3. See SMTP, IMAP and POP3 compared.
Create an app password
- Sign in to your Yahoo account and open the account security page.
- Make sure two-step verification is on, which Yahoo may require before app passwords are offered.
- Choose the option to generate an app password and give the app a recognisable name, for example the script or client that will use it.
- Copy the password shown. It is displayed once; store it in a secret manager or your client configuration, not in source code or a shared document.
- Use this app password in the SMTP password field.
- If you stop using the application, revoke the app password.
Never post the app password in a support request, a chat or a public repository. If you suspect exposure, revoke it and generate a new one.
Example configurations
# PHP (PHPMailer)
$mail->isSMTP();
$mail->Host = 'smtp.mail.yahoo.com';
$mail->SMTPAuth = true;
$mail->Username = '[email protected]';
$mail->Password = getenv('YAHOO_APP_PASSWORD');
$mail->SMTPSecure = PHPMailer::ENCRYPTION_SMTPS; // port 465
$mail->Port = 465;
# Python (smtplib)
import smtplib, os
with smtplib.SMTP_SSL('smtp.mail.yahoo.com', 465) as s:
s.login('[email protected]', os.environ['YAHOO_APP_PASSWORD'])
s.sendmail('[email protected]', ['[email protected]'], msg.as_string())See sending with Python smtplib for more complete examples including STARTTLS on port 587.
Sending limits and behaviour to expect
- Consumer accounts have daily and per-message limits on recipients and total sends. Yahoo publishes figures that can change, so check its current help pages.
- Sending many similar messages in a short time can trigger temporary blocks.
- Attachments are limited in size. See attachment limits.
- Messages sent through the account carry Yahoo's authentication for the yahoo domain, so you cannot sign them with your own domain.
- Delivery data such as per-message events is not provided in a developer-friendly form.
- Forwarded or scripted bulk mail can lead to the account being restricted.
Common errors and fixes
| Symptom | Likely cause | Fix |
|---|---|---|
| Authentication failed (535 style error) | Used the normal password, wrong username or revoked app password | Generate a new app password and use the full address. See 535 authentication failed |
| Connection timed out | Network blocks the port or the wrong host | Try the other port; test with a tool. See testing SMTP connections |
| SSL or TLS handshake error | Wrong security mode for the port | Use SSL/TLS with 465 or STARTTLS with 587 |
| Sender address rejected | From address differs from the account | Send from the authenticated address |
| Message deferred or temporarily blocked | Rate or reputation limits | Slow down and retry later. See 451 temporary errors |
| Mail lands in spam | Content or sending pattern | Review content; consider a proper sending domain. See spam troubleshooting |
| Rejected by DMARC at the recipient | Spoofing a Yahoo address from another server | Do not send from a yahoo address through other servers. See 550 5.7.1 DMARC rejection |
Why not use a consumer mailbox for application mail?
| Concern | Consumer mailbox | Dedicated SMTP relay |
|---|---|---|
| Domain | Yahoo domain only | Your own domain with SPF, DKIM and DMARC |
| Limits | Low and subject to change | Designed for volume |
| Reputation | Shared with all consumers | Managed per domain or IP |
| Events and logs | Minimal | Delivery, bounce and complaint events |
| Suppression handling | Manual | Automatic |
| Support for APIs | No | Yes. See API reference |
| Compliance | Personal use terms | Business terms |
A consumer mailbox is fine for a personal client or a one-off notice. For anything customers depend on, such as receipts, password resets and notifications, use a relay on your own authenticated domain. See authenticating your domain and what an SMTP relay is.
Receiving Yahoo recipients as a sender
If you send to Yahoo addresses, Yahoo applies bulk-sender requirements for authentication, low complaint rates and easy unsubscription. See bulk sender requirements and the Yahoo complaint feedback loop.
Checking the connection step by step
When a client fails to send, test the pieces separately. First confirm that the server name resolves and that you can reach the port from your network; some office and home networks block outgoing connections on certain ports, and cloud hosts often restrict port 25. Second, confirm that the encryption mode matches the port: implicit TLS on 465, STARTTLS on 587. Third, check the credentials with a tool that prints the server responses, so you can see whether the login is accepted. Fourth, send a plain text message to a test address before adding HTML, attachments or large recipient lists. If the login works but the message is refused, the reply text usually explains why.
Keep a record of the exact error message. Vague client errors such as "cannot send" hide the useful detail, while the server reply often names the cause, such as an invalid sender or a rate limit. When you ask for help from a colleague or support team, share the error text and the time of the attempt, never the password.
Running a small server or device
Home servers, scanners, printers and monitoring tools often need a mail account to send alerts. Create a dedicated account for the device rather than using a personal mailbox, give it an app password, limit what it can do and expect occasional authentication failures when the provider changes its security rules. For anything important, send alerts through a relay that you control, so that an expired password on a personal account cannot silence your monitoring.
Security tips
- Use an app password per application so you can revoke one without affecting others.
- Keep credentials out of code; use environment variables or a secret store.
- Prefer encrypted ports only. Do not send credentials over an unencrypted connection.
- Review account activity regularly.
- Remove app passwords you no longer use.
For Yahoo, the recipe is simple: smtp.mail.yahoo.com, port 465 with SSL or 587 with STARTTLS, your full address as username and an app password. Use it for personal mail and small tools, and move application mail to an authenticated relay on your own domain.
Move application mail to a proper relay Send from your own domain with SPF, DKIM, DMARC and delivery events.
References and further reading
Frequently asked questions
What is the Yahoo SMTP server?
smtp.mail.yahoo.com, with port 465 for SSL/TLS or 587 for STARTTLS.
Do I need an app password for Yahoo SMTP?
Yes, for most third-party apps. Generate one in your account security settings and use it instead of your normal password.
What username do I use?
Your full Yahoo email address.
Can I send bulk email through Yahoo SMTP?
It is not designed for that. Consumer limits apply and application mail is better sent through a dedicated relay.
Why is Yahoo rejecting my email?
Common causes are the wrong password type, a mismatched From address, rate limits or DMARC rejection when spoofing a yahoo address.