使用 1and1 云服务器发送电子邮件失败

Sending email with 1and1 cloud server fails

我打算使用1and1 云服务器中的ssmtp 发送电子邮件。发送电子邮件在 1and1 云服务器中不起作用,但它在我的本地主机 windows 和我的 VMWare 服务器 linux 中工作。谁能帮我?请任何人给我一个解决方案。

root=XXXXXX@outlook.com
mailhub=smtp.live.com:587
hostname=localhost.localdomain
AuthUser=XXXXXX
AuthPass=**********
UseSTARTTLS=yes
FromLineOverride=yes

如何使用 1and1 云服务器发送电子邮件?

当前错误如下:

ssmtp: Authorization failed (535 5.7.3 Authentication unsuccessful [DM5PR03CA0053.namprd03.prod.outlook.com])

这是我的一对一云服务器截图。 https://i.stack.imgur.com/rjUvS.png

您可以使用sendgrid服务在1and1云服务器中发送邮件。 请检查此 url: https://sendgrid.com/docs/API_Reference/SMTP_API/getting_started_smtp.html

之后就可以使用express-mailer来发送邮件了,如下:

mailer.extend(app, {
  from: 'Name<your email address>',
  host: 'smtp.sendgrid.net', // hostname 
  secureConnection: false, // use SSL 
  port: 587, // port for secure SMTP 
  transportMethod: 'SMTP', // default is SMTP. Accepts anything that nodemailer accepts 
  auth: {
    user: 'sendgrid ID',
    pass: 'sendgrid password'
  }
});

谢谢。任何时候你都可以使用它。