update Updated January 2026 key App Password Required

iCloud Mail SMTP Settings (2026)

Complete guide to configure Apple iCloud Mail SMTP for sending emails from your applications. Learn how to create App-Specific Passwords and integrate with Python, PHP, Node.js, and more.

iCloud iCloud SMTP Quick Reference

SMTP Server smtp.mail.me.com
Port (STARTTLS) 587 (Recommended)
Port (SSL/TLS) 465 (Alternative)
Username Your full iCloud email (example@icloud.com)
Password App-Specific Password (NOT your Apple ID password)
Authentication LOGIN / PLAIN
Supported Domains @icloud.com @me.com @mac.com
Apple

App-Specific Password Required

Apple requires App-Specific Passwords for all third-party applications. Your regular Apple ID password will NOT work for SMTP. You must:

  1. Have Two-Factor Authentication enabled on your Apple ID (required for all new accounts)
  2. Generate an App-Specific Password at appleid.apple.com
  3. Use the generated 16-character password for SMTP authentication
warning

Personal Use Only

iCloud Mail is designed for personal email, not bulk mailing or marketing campaigns. Sending high volumes may result in temporary account throttling or suspension. For business email, consider SendGrid, Mailgun, or Amazon SES.

1 Enable Two-Factor Authentication

Two-Factor Authentication (2FA) is required for App-Specific Passwords. Most Apple IDs created after 2019 have 2FA enabled by default. To check or enable it:

smartphone On iPhone, iPad, or Mac:

  1. Go to Settings > [Your Name] > Sign-In & Security
  2. Tap Two-Factor Authentication
  3. Follow the prompts to enable if not already on

language On the web:

  1. Go to appleid.apple.com
  2. Sign in with your Apple ID
  3. Navigate to Sign-In and Security > Two-Factor Authentication

check_circle If you see 'Two-Factor Authentication: On' in your Apple ID settings, you're ready to create an App-Specific Password.

2 Generate App-Specific Password

1

Go to Apple ID Account Page

Sign in with your Apple ID:

https://appleid.apple.com/account/manage open_in_new
2

Navigate to App-Specific Passwords

Go to Sign-In and Security > App-Specific Passwords

3

Click 'Generate an app-specific password'

Or click the '+' button to create a new password.

4

Enter a label

Give it a descriptive name (e.g., 'SMTP Client', 'My App', 'Website Email').

5

Copy your App-Specific Password

Apple will display a 16-character password in this format:

abcd-efgh-ijkl-mnop

Important: Copy this password now! Apple will only show it once. When using it for SMTP, you can enter it with or without the dashes.

3 Configure SMTP Settings

Use these settings in your email client or application:

# iCloud Mail SMTP Configuration
SMTP_HOST=smtp.mail.me.com
SMTP_PORT=587        # STARTTLS (recommended)
SMTP_SECURITY=TLS    # or SSL for port 465
SMTP_USERNAME=your-email@icloud.com
SMTP_PASSWORD=abcd-efgh-ijkl-mnop  # App-Specific Password

code Code Examples

# Python - Using smtplib (standard library)
import smtplib
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart

# iCloud SMTP Configuration
SMTP_HOST = "smtp.mail.me.com"
SMTP_PORT = 587  # STARTTLS
ICLOUD_EMAIL = "your-email@icloud.com"
APP_PASSWORD = "abcd-efgh-ijkl-mnop"  # App-Specific Password

def send_email(to_email, subject, body):
    # Create message
    msg = MIMEMultipart()
    msg['From'] = ICLOUD_EMAIL
    msg['To'] = to_email
    msg['Subject'] = subject
    msg.attach(MIMEText(body, 'plain'))

    # Connect using STARTTLS (port 587)
    with smtplib.SMTP(SMTP_HOST, SMTP_PORT) as server:
        server.starttls()  # Upgrade to TLS
        server.login(ICLOUD_EMAIL, APP_PASSWORD)
        server.send_message(msg)
        print("Email sent successfully!")

# Alternative: Using SSL (port 465)
def send_email_ssl(to_email, subject, body):
    msg = MIMEMultipart()
    msg['From'] = ICLOUD_EMAIL
    msg['To'] = to_email
    msg['Subject'] = subject
    msg.attach(MIMEText(body, 'plain'))

    with smtplib.SMTP_SSL(SMTP_HOST, 465) as server:
        server.login(ICLOUD_EMAIL, APP_PASSWORD)
        server.send_message(msg)

# Usage
send_email(
    "recipient@example.com",
    "Hello from iCloud!",
    "This email was sent via iCloud Mail SMTP."
)
// PHP - Using PHPMailer
// Install: composer require phpmailer/phpmailer

use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\SMTP;
use PHPMailer\PHPMailer\Exception;

require 'vendor/autoload.php';

$mail = new PHPMailer(true);

try {
    // Server settings
    $mail->isSMTP();
    $mail->Host       = 'smtp.mail.me.com';
    $mail->SMTPAuth   = true;
    $mail->Username   = 'your-email@icloud.com';
    $mail->Password   = 'abcd-efgh-ijkl-mnop';  // App-Specific Password
    $mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS;
    $mail->Port       = 587;

    // For SSL (port 465) use:
    // $mail->SMTPSecure = PHPMailer::ENCRYPTION_SMTPS;
    // $mail->Port       = 465;

    // Recipients
    $mail->setFrom('your-email@icloud.com', 'Your Name');
    $mail->addAddress('recipient@example.com');

    // Content
    $mail->isHTML(true);
    $mail->Subject = 'Hello from iCloud!';
    $mail->Body    = 'This is a <b>test email</b> sent via iCloud SMTP.';
    $mail->AltBody = 'This is a test email sent via iCloud SMTP.';

    $mail->send();
    echo 'Email sent successfully!';
} catch (Exception $e) {
    echo "Failed to send: {$mail->ErrorInfo}";
}
// Node.js - Using Nodemailer
// Install: npm install nodemailer

const nodemailer = require('nodemailer');

// Create transporter with iCloud SMTP
const transporter = nodemailer.createTransport({
    host: 'smtp.mail.me.com',
    port: 587,
    secure: false, // Use STARTTLS
    auth: {
        user: 'your-email@icloud.com',
        pass: 'abcd-efgh-ijkl-mnop' // App-Specific Password
    },
    tls: {
        ciphers: 'SSLv3'
    }
});

// For SSL (port 465) use:
// const transporter = nodemailer.createTransport({
//     host: 'smtp.mail.me.com',
//     port: 465,
//     secure: true,
//     auth: { user: '...', pass: '...' }
// });

// Send email
async function sendEmail() {
    try {
        const info = await transporter.sendMail({
            from: '"Your Name" <your-email@icloud.com>',
            to: 'recipient@example.com',
            subject: 'Hello from iCloud!',
            text: 'This email was sent via iCloud SMTP.',
            html: '<p>This email was sent via <b>iCloud SMTP</b>.</p>'
        });

        console.log('Email sent:', info.messageId);
    } catch (error) {
        console.error('Error sending email:', error);
    }
}

sendEmail();
# Ruby - Using Mail gem
# Install: gem install mail

require 'mail'

# Configure iCloud SMTP
Mail.defaults do
  delivery_method :smtp, {
    address:              'smtp.mail.me.com',
    port:                 587,
    user_name:            'your-email@icloud.com',
    password:             'abcd-efgh-ijkl-mnop',  # App-Specific Password
    authentication:       :login,
    enable_starttls_auto: true
  }
end

# Create and send email
mail = Mail.new do
  from     'your-email@icloud.com'
  to       'recipient@example.com'
  subject  'Hello from iCloud!'
  body     'This email was sent via iCloud Mail SMTP.'
end

mail.deliver!
puts "Email sent successfully!"
// Swift - Using SwiftSMTP
// Add to Package.swift: .package(url: "https://github.com/Kitura/Swift-SMTP")

import SwiftSMTP

// Configure iCloud SMTP
let smtp = SMTP(
    hostname: "smtp.mail.me.com",
    email: "your-email@icloud.com",
    password: "abcd-efgh-ijkl-mnop",  // App-Specific Password
    port: 587,
    tlsMode: .requireSTARTTLS,
    tlsConfiguration: nil
)

// Create email
let from = Mail.User(
    name: "Your Name",
    email: "your-email@icloud.com"
)
let to = Mail.User(
    name: "Recipient",
    email: "recipient@example.com"
)

let mail = Mail(
    from: from,
    to: [to],
    subject: "Hello from iCloud!",
    text: "This email was sent via iCloud SMTP using Swift."
)

// Send email
smtp.send(mail) { error in
    if let error = error {
        print("Error: \(error)")
    } else {
        print("Email sent successfully!")
    }
}

alternate_email iCloud Email Aliases

You can send emails using any of your iCloud email aliases. All these domains work with the same SMTP settings:

@icloud.com

Standard iCloud email

@me.com

MobileMe legacy

@mac.com

.Mac legacy

info You can create up to 3 email aliases in iCloud Mail settings. All aliases share the same inbox and can be used for sending with SMTP.

speed iCloud Mail Sending Limits

Limit Type Value
Messages per day 1,000
Recipients per message 500
Max message size 20 MB
Attachment size 20 MB (or use Mail Drop for up to 5 GB)
Email aliases 3

build Troubleshooting

error 535 Authentication failed
expand_more

This is the most common error with iCloud SMTP.

Solutions:

  • check_circle Use an App-Specific Password: Your regular Apple ID password will NOT work. Generate an App-Specific Password at appleid.apple.com
  • check_circle Verify 2FA is enabled on your Apple ID
  • check_circle Use your full iCloud email as username (not just the part before @)
  • check_circle If your password has dashes (abcd-efgh-ijkl-mnop), try with or without them
error Connection timeout / Connection refused
expand_more

Unable to connect to Apple's SMTP server.

Solutions:

  • check_circle Check if your firewall/ISP blocks port 587 or 465
  • check_circle Try switching between port 587 (STARTTLS) and 465 (SSL)
  • check_circle Verify the hostname is exactly smtp.mail.me.com
  • check_circle Check Apple System Status: apple.com/support/systemstatus
error 550 5.1.0 Sender denied
expand_more

The 'From' address doesn't match your iCloud account.

Solutions:

  • check_circle Use your iCloud email address or a verified alias as the 'From' address
  • check_circle The 'From' address must match the account you're authenticating with
warning Can't generate App-Specific Password
expand_more

The App-Specific Passwords option is not available.

Solutions:

  • check_circle Enable Two-Factor Authentication first — App-Specific Passwords require 2FA to be active
  • check_circle Sign out and sign back in to appleid.apple.com
  • check_circle Try using Safari browser (some features work best in Safari)
  • check_circle Ensure your Apple ID is in good standing (no unpaid bills, etc.)

quiz Frequently Asked Questions

Why can't I use my Apple ID password for SMTP? expand_more

Apple requires App-Specific Passwords for all third-party apps as a security measure. This way, if a password is compromised, your main Apple ID remains secure. You can revoke individual App-Specific Passwords without affecting your Apple ID or other apps. App-Specific Passwords only work for the specific service they're created for and cannot be used to access your Apple ID account directly.

How many App-Specific Passwords can I create? expand_more

You can have up to 25 active App-Specific Passwords at any time. If you need more, you can revoke old passwords that are no longer in use. It's recommended to create a separate password for each application so you can revoke access to one without affecting others.

Can I send from @me.com or @mac.com addresses? expand_more

Yes! If you have legacy @me.com (from MobileMe) or @mac.com (from .Mac) email addresses associated with your Apple ID, you can use them with the same SMTP settings. These are treated as aliases of your iCloud account. The SMTP server (smtp.mail.me.com), port, and App-Specific Password remain the same—just change the 'From' address to your preferred alias.

Does iCloud support sending from a custom domain? expand_more

With iCloud+, Apple now supports custom email domains. You can add your own domain to iCloud Mail and use it for sending. However, for business or high-volume email, dedicated services like SendGrid, Mailgun, or Amazon SES are more appropriate as they offer better deliverability, analytics, and higher sending limits.

Should I use port 587 or 465? expand_more

Both ports work with iCloud Mail:

  • Port 587 (STARTTLS): Recommended. Starts unencrypted then upgrades to TLS. More widely supported by libraries and firewalls.
  • Port 465 (SSL/TLS): Alternative. Connection is encrypted from the start. Use if port 587 is blocked.

Need Higher Sending Limits?

iCloud Mail is great for personal use, but for business email campaigns you'll need a dedicated email service with higher limits and better deliverability tracking.