nodemailer发送邮件各个服务器接口

来自:https://github.com/nodemailer/nodemailer-wellknown/blob/master/services.json

{
    "1und1": {
        "host": "smtp.1und1.de",
        "port": 465,
        "secure": true,
        "authMethod": "LOGIN"
    },

    "AOL": {
        "domains": [
            "aol.com"
        ],
        "host": "smtp.aol.com",
        "port": 587
    },

    "DebugMail": {
        "host": "debugmail.io",
        "port": 25
    },

    "DynectEmail": {
        "aliases": ["Dynect"],
        "host": "smtp.dynect.net",
        "port": 25
    },

    "FastMail": {
        "domains": [
            "fastmail.fm"
        ],
        "host": "mail.messagingengine.com",
        "port": 465,
        "secure": true
    },

    "GandiMail": {
        "aliases": [
            "Gandi",
            "Gandi Mail"
        ],
        "host": "mail.gandi.net",
        "port": 587
    },

    "Gmail": {
        "aliases": [
            "Google Mail"
        ],
        "domains": [
            "gmail.com",
            "googlemail.com"
        ],
        "host": "smtp.gmail.com",
        "port": 465,
        "secure": true
    },

    "Godaddy": {
        "host": "smtpout.secureserver.net",
        "port": 25
    },

    "GodaddyAsia": {
        "host": "smtp.asia.secureserver.net",
        "port": 25
    },

    "GodaddyEurope": {
        "host": "smtp.europe.secureserver.net",
        "port": 25
    },

    "hot.ee": {
        "host": "mail.hot.ee"
    },

    "Hotmail": {
        "aliases": [
            "Outlook",
            "Outlook.com",
            "Hotmail.com"
        ],
        "domains": [
            "hotmail.com",
            "outlook.com"
        ],
        "host": "smtp.live.com",
        "port": 587,
        "tls": {
            "ciphers": "SSLv3"
        }
    },

    "iCloud": {
        "aliases": ["Me", "Mac"],
        "domains": [
            "me.com",
            "mac.com"
        ],
        "host": "smtp.mail.me.com",
        "port": 587
    },

    "mail.ee": {
        "host": "smtp.mail.ee"
    },

    "Mail.ru": {
        "host": "smtp.mail.ru",
        "port": 465,
        "secure": true
    },

    "Maildev": {
        "port": 1025,
        "ignoreTLS": true
    },

    "Mailgun": {
        "host": "smtp.mailgun.org",
        "port": 465,
        "secure": true
    },

    "Mailjet": {
        "host": "in.mailjet.com",
        "port": 587
    },

    "Mailosaur": {
        "host": "mailosaur.io",
        "port": 25
    },

    "Mandrill": {
        "host": "smtp.mandrillapp.com",
        "port": 587
    },

    "Naver": {
        "host": "smtp.naver.com",
        "port": 587
    },

    "OpenMailBox": {
        "aliases": [
            "OMB",
            "openmailbox.org"
        ],
        "host": "smtp.openmailbox.org",
        "port": 465,
        "secure": true
    },

    "Outlook365": {
      "host": "smtp.office365.com",
      "port": 587,
      "secure": false
    },

    "Postmark": {
        "aliases": ["PostmarkApp"],
        "host": "smtp.postmarkapp.com",
        "port": 2525
    },

    "QQ": {
        "domains": [
            "qq.com"
        ],
        "host": "smtp.qq.com",
        "port": 465,
        "secure": true
    },

    "QQex": {
        "aliases": ["QQ Enterprise"],
        "domains": [
            "exmail.qq.com"
        ],
        "host": "smtp.exmail.qq.com",
        "port": 465,
        "secure": true
    },

    "SendCloud": {
        "host": "smtpcloud.sohu.com",
        "port": 25
    },

    "SendGrid": {
        "host": "smtp.sendgrid.net",
        "port": 587
    },

    "SendinBlue": {
        "host": "smtp-relay.sendinblue.com",
        "port": 587
    },

    "SES": {
        "host": "email-smtp.us-east-1.amazonaws.com",
        "port": 465,
        "secure": true
    },
    "SES-US-EAST-1": {
        "host": "email-smtp.us-east-1.amazonaws.com",
        "port": 465,
        "secure": true
    },
    "SES-US-WEST-2": {
        "host": "email-smtp.us-west-2.amazonaws.com",
        "port": 465,
        "secure": true
    },
    "SES-EU-WEST-1": {
        "host": "email-smtp.eu-west-1.amazonaws.com",
        "port": 465,
        "secure": true
    },


    "Sparkpost": {
        "aliases": [
            "SparkPost",
            "SparkPost Mail"
        ],
        "domains": [
            "sparkpost.com"
        ],
        "host": "smtp.sparkpostmail.com",
        "port": 587,
        "secure": false
    },
    
    "Tipimail": {
        "aliases": [
            "tipimail"
        ],
        "host": "smtp.tipimail.com",
        "port": 587
    },

    "Yahoo": {
        "domains": [
            "yahoo.com"
        ],
        "host": "smtp.mail.yahoo.com",
        "port": 465,
        "secure": true
    },

    "Yandex": {
        "domains": [
            "yandex.ru"
        ],
        "host": "smtp.yandex.ru",
        "port": 465,
        "secure": true
    },

    "Zoho": {
        "host": "smtp.zoho.com",
        "port": 465,
        "secure": true,
        "authMethod": "LOGIN"
    },
    "126": {
        "host": "smtp.126.com",
        "port": 465,
        "secure": true
    },
    "163": {
        "host": "smtp.163.com",
        "port": 465,
        "secure": true
    },
    "qiye.aliyun": {
        "host":"smtp.mxhichina.com",
        "port":"465",
        "secure": true
    },
    "One": {
        "host": "send.one.com",
        "port": 465,
        "secure": true
    },
    "DREAMHOST-SUB-0": {
        "host": "smtp.dreamhost.com",
        "port": 465,
        "secure": true
    },
    "DREAMHOST-SUB-3": {
        "host": "sub3.mail.dreamhost.com",
        "port": 465,
        "secure": true
    },
    "DREAMHOST-SUB-4": {
        "host": "sub4.mail.dreamhost.com",
        "port": 465,
        "secure": true
    },
    "DREAMHOST-SUB-5": {
        "host": "sub5.mail.dreamhost.com",
        "port": 465,
        "secure": true
    },
    "DREAMHOST-MASTER": {
        "host": "homie.mail.dreamhost.com",
        "port": 465,
        "secure": true
    }
}

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
当然可以!nodemailer是一个流行的Node.js库,用于发送电子邮件。下面是一个简单的nodemailer发送邮件的教程: 1. 首先,确保你已经安装了Node.js和npm。 2. 在你的项目文件夹中,打开终端并运行以下命令来安装nodemailer: ``` npm install nodemailer ``` 3. 创建一个新的JavaScript文件,比如`sendEmail.js`。 4. 在文件中引入nodemailer模块: ```javascript const nodemailer = require('nodemailer'); ``` 5. 创建一个邮件传输对象,并配置SMTP传输选项: ```javascript let transporter = nodemailer.createTransport({ service: 'Gmail', auth: { user: 'your_email@gmail.com', pass: 'your_password' } }); ``` 请注意,这里使用了Gmail作为邮件服务提供商,你需要替换成你自己的邮箱地址和密码。 6. 创建一个包含邮件内容的选项对象: ```javascript let mailOptions = { from: 'your_email@gmail.com', to: 'recipient_email@example.com', subject: 'Hello from nodemailer', text: 'This is a test email sent using nodemailer.' }; ``` 请将`from`字段替换为你自己的邮箱地址,`to`字段替换为收件人的邮箱地址。 7. 使用`transporter.sendMail()`方法发送邮件: ```javascript transporter.sendMail(mailOptions, function(error, info){ if (error) { console.log(error); } else { console.log('Email sent: ' + info.response); } }); ``` 如果邮件发送成功,你将会在控制台看到`Email sent: <message_id>`的输出。 这就是一个简单的nodemailer发送邮件的教程。你可以根据自己的需求进行更多的配置,比如添加附件、HTML内容等。如果你想了解更多关于nodemailer的详细信息,可以查阅官方文档:https://nodemailer.com/about/
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值