Error with verification email


#1

I’m using the meteor chef tutorial to verify my new user but instead of using flowrouter I’m using iron router to do the job, then I set MAIL_URL to run some tests but it got me an error and I’m not quite sure what’s happening.

This is the error that shows up

Exception while invoking method 'sendVerificationLink' { Error: Message failed: 554 5.2.0 STOREDRV.Submission.Exception:SendAsDeniedException.MapiExceptionSendAsDenied; Failed to process message due to a permanent exception with message Cannot submit message. 16.55847:E2030000, 17.43559:0000000094000000000000000000000000000000, 20.52176:140F168600004010F1030000, 20.50032:140F168670174010F1030000, 0.35180:1D120000, 255.23226:00000000, 255.27962:0A000000, 255.27962:0E000000, 255.31418:140F1686, 16.55847:B6000000, 17.43559:0000000070010000000000000000000000000000, 20.52176:140F16860000F01F0A000000, 20.50032:140F168670170011800F0000, 0.35180:00000000, 255.23226:00000000, 255.27962:0A000000, 255.27962:32000000, 255.17082:DC040000, 0.27745:140F1686, 4.21921:DC040000, 255.27962:FA000000, 255.1494:68000000, 0.38698:00000000, 0.37692:0F010480, 0.37948:05000100, 5.33852:00000000534D545000000000, 4.56248:DC040000, 7.40748:010000000000010B00000000, 7.57132:000000000000000000000000, 1.63016:32000000, 4.39640:DC040000, 8.45434:FDBF0600E5DD2234000000000000000000000000, 5.10786:0000000031352E32302E313535382E3030303A424E38505231344D42333134303A38383337666637652D643864302D346566362D386637372D32333862396263306532326600000000000000, 255.1750:A4000000, 255.31418:0A005636, 0.22753:A9000000, 255.21817:DC040000, 4.60547:DC040000, 0.21966:03003866, 4.30158:DC040000 [Hostname=BN8PR14MB3140.namprd14.prod.outlook.com]
I20190126-17:44:39.161(-4)?     at SMTPConnection._formatError (/home/frederick/.meteor/packages/email/.1.2.3.b74gtr.eucmo++os+web.browser+web.cordova/npm/node_modules/node4mailer/lib/smtp-connection/index.js:558:19)
I20190126-17:44:39.162(-4)?     at SMTPConnection._actionSMTPStream (/home/frederick/.meteor/packages/email/.1.2.3.b74gtr.eucmo++os+web.browser+web.cordova/npm/node_modules/node4mailer/lib/smtp-connection/index.js:1386:34)
I20190126-17:44:39.162(-4)?     at SMTPConnection._responseActions.push.str (/home/frederick/.meteor/packages/email/.1.2.3.b74gtr.eucmo++os+web.browser+web.cordova/npm/node_modules/node4mailer/lib/smtp-connection/index.js:908:22)
I20190126-17:44:39.162(-4)?     at SMTPConnection._processResponse (/home/frederick/.meteor/packages/email/.1.2.3.b74gtr.eucmo++os+web.browser+web.cordova/npm/node_modules/node4mailer/lib/smtp-connection/index.js:707:20)
I20190126-17:44:39.162(-4)?     at SMTPConnection._onData (/home/frederick/.meteor/packages/email/.1.2.3.b74gtr.eucmo++os+web.browser+web.cordova/npm/node_modules/node4mailer/lib/smtp-connection/index.js:510:14)
I20190126-17:44:39.163(-4)?     at TLSSocket._socket.on.chunk (/home/frederick/.meteor/packages/email/.1.2.3.b74gtr.eucmo++os+web.browser+web.cordova/npm/node_modules/node4mailer/lib/smtp-connection/index.js:658:51)
I20190126-17:44:39.163(-4)?     at emitOne (events.js:116:13)
I20190126-17:44:39.163(-4)?     at TLSSocket.emit (events.js:211:7)
I20190126-17:44:39.163(-4)?     at addChunk (_stream_readable.js:263:12)
I20190126-17:44:39.163(-4)?     at readableAddChunk (_stream_readable.js:250:11)
I20190126-17:44:39.163(-4)?     at TLSSocket.Readable.push (_stream_readable.js:208:10)
I20190126-17:44:39.164(-4)?     at TLSWrap.onread (net.js:597:20)
I20190126-17:44:39.164(-4)?   code: 'EMESSAGE',
I20190126-17:44:39.164(-4)?   response: '554 5.2.0 STOREDRV.Submission.Exception:SendAsDeniedException.MapiExceptionSendAsDenied; Failed to process message due to a permanent exception with message Cannot submit message. 16.55847:E2030000, 17.43559:0000000094000000000000000000000000000000, 20.52176:140F168600004010F1030000, 20.50032:140F168670174010F1030000, 0.35180:1D120000, 255.23226:00000000, 255.27962:0A000000, 255.27962:0E000000, 255.31418:140F1686, 16.55847:B6000000, 17.43559:0000000070010000000000000000000000000000, 20.52176:140F16860000F01F0A000000, 20.50032:140F168670170011800F0000, 0.35180:00000000, 255.23226:00000000, 255.27962:0A000000, 255.27962:32000000, 255.17082:DC040000, 0.27745:140F1686, 4.21921:DC040000, 255.27962:FA000000, 255.1494:68000000, 0.38698:00000000, 0.37692:0F010480, 0.37948:05000100, 5.33852:00000000534D545000000000, 4.56248:DC040000, 7.40748:010000000000010B00000000, 7.57132:000000000000000000000000, 1.63016:32000000, 4.39640:DC040000, 8.45434:FDBF0600E5DD2234000000000000000000000000, 5.10786:0000000031352E32302E313535382E3030303A424E38505231344D42333134303A38383337666637652D643864302D346566362D386637372D32333862396263306532326600000000000000, 255.1750:A4000000, 255.31418:0A005636, 0.22753:A9000000, 255.21817:DC040000, 4.60547:DC040000, 0.21966:03003866, 4.30158:DC040000 [Hostname=BN8PR14MB3140.namprd14.prod.outlook.com]',
I20190126-17:44:39.164(-4)?   responseCode: 554,
I20190126-17:44:39.164(-4)?   command: 'DATA' }

This is how I set the process.env.MAIL_URL

process.env.MAIL_URL = "smtp://*****hotmail.com:*********@smtp.outlook.com:587";

How I’m setting the route with iron router

Router.route('/verify-email/:token', {
  name: 'VerifyEmail',
  action(params) {
    Accounts.verifyEmail(params.token, (error) => {
      if (error) {
        Bert.alert(error.reason + "Error de confirmacion", 'danger', 'growl-top-right');
      } else {
        Router.go('/');
        Bert.alert('Correo confirmado exitosamente', 'success', 'growl-top-right');
      }
    });
  }
});

The method that calls after registering

Accounts.createUser(user, (error) => {
        if (error) {
          //If an error occurs it will be displayed
          Bert.alert("Credenciales invalidas", "danger", "growl-top-right");
        } else {
          /**If there are no errors this meteor call will be triggered
           * And it will send to the email that's linked to the created user an URL to verify there email
           */

          Meteor.call('sendVerificationLink', (error, msg) => {
            if (error) {
              Bert.alert("Error de verificación", "danger", "growl-top-right");
            } else {
              Bert.alert("Registro exitoso!", "success", "growl-top-right");
              //Router.go("/Verify");
            }
          })
        }
      });

    }

And the method in my server side

Meteor.methods({
    sendVerificationLink(){
        let userId = Meteor.userId();
        if(userId){
            return Accounts.sendVerificationEmail(userId);
        }
    }
});

#2

Check that you wrote your email address correctly and try using smtp-mail.outlook.com:587 instead of smtp.outlook.com:587.

If that doesn’t do it, I don’t know, but there’s a lot of conversation out there about this error, just google MapiExceptionSendAsDenied


#3

It was the special characters, rookie mistake, thanks for the help man :grin: