Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

recieve mail on @hotmail.com doesn't work #748

Closed
curlynux opened this issue Mar 15, 2017 · 5 comments
Closed

recieve mail on @hotmail.com doesn't work #748

curlynux opened this issue Mar 15, 2017 · 5 comments

Comments

@curlynux
Copy link

curlynux commented Mar 15, 2017

Include the following information with your issue:

node version: v6.8.1,
nodemailer version: nodemailer@3.1.5,
os x sierra: Darwin Kernel Version 16.1.0,
my code:
`app.post('/contact', (req, res) => {
var transporter = nodemailer.createTransport({
host: "smtp-mail.outlook.com",
secureConnection: true,
port: 587,
tls: {
ciphers: 'starttls'
},
service: 'hotmail',
auth: {
user: 'email',
pass: 'Passwd'
}
});
var sender = req.body.email;
var sujet = req.body.sujet;
var texte = req.body.message;

var mailOptions = {
from: sender,
to: 'email',
subject: sujet,
text: texte
//html: '

le formulaire marche'
};

transporter.sendMail(mailOptions, (error, info) => {
if (error) {
return console.error(error);
} else {
console.log('Message %s envoyer: %s', info.messageId, info.response);
}
});

res.send('req recieved');
});`

my error in the console: POST /contact 200 40.613 ms - 12 { Error: Message failed: 550 5.3.4 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:69000000, 17.43559:0000000020010000000000000000000000000000, 20.521 at SMTPConnection._formatError (/Users/macair/Documents/express-khasso/node_modules/nodemailer/lib/smtp-connection/index.js:555:19) at SMTPConnection._actionSMTPStream (/Users/macair/Documents/express-khasso/node_modules/nodemailer/lib/smtp-connection/index.js:1376:34) at SMTPConnection._responseActions.push.str (/Users/macair/Documents/express-khasso/node_modules/nodemailer/lib/smtp-connection/index.js:903:22) at SMTPConnection._processResponse (/Users/macair/Documents/express-khasso/node_modules/nodemailer/lib/smtp-connection/index.js:702:20) at SMTPConnection._onData (/Users/macair/Documents/express-khasso/node_modules/nodemailer/lib/smtp-connection/index.js:507:14) at TLSSocket._socket.on.chunk (/Users/macair/Documents/express-khasso/node_modules/nodemailer/lib/smtp-connection/index.js:653:51) at emitOne (events.js:96:13) at TLSSocket.emit (events.js:188:7) at readableAddChunk (_stream_readable.js:176:18) at TLSSocket.Readable.push (_stream_readable.js:134:10) code: 'EMESSAGE', response: '550 5.3.4 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:69000000, 17.43559:0000000020010000000000000000000000000000, 20.521', responseCode: 550, command: 'DATA' }

@andris9
Copy link
Member

andris9 commented Mar 15, 2017

This usually happens when you try to send emails from an address that you are not authorized to use, eg your user is "email@hotmail.com" but you try to send mails as "someotheruser@hotmail.com".

@andris9 andris9 closed this as completed Mar 15, 2017
@curlynux
Copy link
Author

curlynux commented Mar 15, 2017 via email

@curlynux
Copy link
Author

curlynux commented Mar 29, 2017

i'm still with the same error, i can send email with the same config but can't recieve email. here is the error i get same as mentioned up:

my config:

app.post('/contact', (req, res) => { var transporter = nodemailer.createTransport({ service: 'outlook', host: "smtp-mail.outlook.com", // hostname secureConnection: false, // TLS requires secureConnection to be false port: 587, tls: { rejectUnauthorized: false }, auth: { user: 'exemple-test@outlook.fr', pass: 'passwd' } }); var sender = req.body.email; var sujet = req.body.sujet; var texte = req.body.message; var outlook = 'test@outlook.fr'; var gmail = 'test@gmail.com'; var mailOptions = { from: gmail, to: outlook, subject: sujet, text: texte, html: '<p>le formulaire marche</p>' }; transporter.sendMail(mailOptions, (error, info) => { if (error) { return console.error(error); } else { console.log('Message %s envoyer: %s', info.messageId, info.response); } }); res.send('req recieved'); transporter.close();

});

{ Error: Message failed: 550 5.3.4 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:69000000, 17.43559:0000000048010000000000000800000000000000, 20.521 at SMTPConnection._formatError (/home/curlynux/Documents/express-khasso/node_modules/nodemailer/lib/smtp-connection/index.js:555:19) at SMTPConnection._actionSMTPStream (/home/curlynux/Documents/express-khasso/node_modules/nodemailer/lib/smtp-connection/index.js:1376:34) at SMTPConnection._responseActions.push.str (/home/curlynux/Documents/express-khasso/node_modules/nodemailer/lib/smtp-connection/index.js:903:22) at SMTPConnection._processResponse (/home/curlynux/Documents/express-khasso/node_modules/nodemailer/lib/smtp-connection/index.js:702:20) at SMTPConnection._onData (/home/curlynux/Documents/express-khasso/node_modules/nodemailer/lib/smtp-connection/index.js:507:14) at TLSSocket._socket.on.chunk (/home/curlynux/Documents/express-khasso/node_modules/nodemailer/lib/smtp-connection/index.js:653:51) at emitOne (events.js:96:13) at TLSSocket.emit (events.js:189:7) at readableAddChunk (_stream_readable.js:176:18) at TLSSocket.Readable.push (_stream_readable.js:134:10) code: 'EMESSAGE', response: '550 5.3.4 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:69000000, 17.43559:0000000048010000000000000800000000000000, 20.521', responseCode: 550, command: 'DATA' }

and the output when i change the mail to send not recieve:

Message <b60079b4-460d-bf6e-f68f-94fdf7504d27@outlook.fr> envoyer: 250 2.6.0 <b60079b4-460d-bf6e-f68f-94fdf7504d27@outlook.fr> Queued mail for delivery

@user1m
Copy link

user1m commented Aug 21, 2018

To fix you need to change the FROM email to be your email. Essentially outlook doesn't let you send email from a account you don't own. So take the original user's email and put it in the body of the text then make the FROM to be your email TO your email.

Solution found in the last comment here: https://social.technet.microsoft.com/Forums/exchange/en-US/69426f64-717d-47e0-aa1b-700903ee83cc/520-storedrv-error?forum=exchangesvrsecuremessaginglegacy

This applies to all email clients using smtp-mail.outlook.com to send email. Sometime near the beginning of July, there was a change that disallowed you using a return email address that is not in your list of verified email aliases or connected accounts. In other words, you can't change the "From" field in emails you send to an anonymous email address.

@wilkinson4
Copy link

@user1m Thank you for this advice!! This fixed mine immediately as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants