Search code examples
node.jsoutlooksendmailssmtp

Sending email with 1and1 cloud server fails


I am going to send email by using the ssmtp in 1and1 cloud server. Sending email is not working in 1and1 cloud server but it is working in windows which is my localhost and linux server which is my VMWare. Who can help me? Please anyone suggest me a solution.

[email protected]
mailhub=smtp.live.com:587
hostname=localhost.localdomain
AuthUser=XXXXXX
AuthPass=**********
UseSTARTTLS=yes
FromLineOverride=yes

How can I send an email using 1and1 cloud server?

Current error is as follows:

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

This is my 1and1 cloud server screenshot. https://i.sstatic.net/rjUvS.png


Solution

  • You can use sendgrid service to send email in 1and1 cloud server. Please check this url: https://sendgrid.com/docs/API_Reference/SMTP_API/getting_started_smtp.html

    After that you can use express-mailer to send email as below:

    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'
      }
    });
    

    Thanks. Anytime you can use this.