如何配置注册邮箱

最后更新于:2023-02-13 07:25:05

首先确定自己的服务器是否允许发送邮件!!

1.这里以搜狐邮箱为例

service:服务名称

user:邮箱账号

pass:设置的pop密码

host:邮箱host

port:端口,一般是465或25,具体见文章底部

secure:设置true就是465端口,设置false就是其他端口

from:邮箱地址

subject:副标题

html:发送的邮箱内容,注意${code}就是验证码的位置,不可随意改动,其他文字可以改动

如果测试发现邮箱不能正常发送,请检测以下内容

1.邮箱配置是否正确

2.是否重启了pm2

3.服务器是否能连接到邮箱服务器

具体服务名称如下:

{
    "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
    },

    "Ethereal": {
        "aliases": ["ethereal.email"],
        "host": "smtp.ethereal.email",
        "port": 587
    },

    "FastMail": {
        "domains": ["fastmail.fm"],
        "host": "smtp.fastmail.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
    },

    "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
    },

    "Mailtrap": {
        "host": "smtp.mailtrap.io",
        "port": 2525
    },

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

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

    "One": {
        "host": "send.one.com",
        "port": 465,
        "secure": true
    },

    "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
    },

    "qiye.aliyun": {
        "host": "smtp.mxhichina.com",
        "port": "465",
        "secure": true
    },

    "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
    },

    "SendPulse": {
        "host": "smtp-pulse.com",
        "port": 465,
        "secure": true
    },

    "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": {
        "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
    }
}