Closed rosbm closed 7 years ago
Hi @rosbm, I'll test it today.
@rosbm which .send()
method do you use?
Yes .send() method
:-D Which? Mail.send()
or message.send()
? Can you send me a line of your code with .send()
method?
Here is an example of the send code I'm using:
` var message = new mail.Message(subject, body);
message.to(toMail);
message.from(mail_manager, nameManager); mail.on('error', function (err) { connection.query( query, function(error, result, fields){ if (error === null && result.length!=0){ console.log('send error! lead ID ' + toMailID + '; userID ' + mailManagerID, '; msgId ' + idMsgSubmit); } }); }); message.send(smtp_val, { port: smtp_port, secure: true, user: mail_manager, password: mail_pass }); `
You have a problem with mail.on('error')
, right? I thought that you mean a callback
. I'm going to test it.
Yes problem with mail.on('error').
What is better to use to display error messages: Mail.on('error') or message.callback(fn)?
Better is to use send
with callback
. I'll test error within sending and everything works correctly. I will need more info for debugging.
What mail servers did you test? Gmail?
Yes and my personal and fake server (there was a timeout error). Can you send me on my email your SMTP server? You don't have to send credentials.
The error is not explicitly generated by the framework, if I send it from the server: smtp.yandex.ru (SSL port: 465).
Rather, I would say this: an error is generated, but for some reason it does not return to the console.
And when I send mail from this server: smtp.mail.ru (SSL port: 465), I simultaneously receive output to the error console from both the smtp.yandex.ru server (by previous mail sending) and from the server smtp.mail.ru (SSL port: 465).
Hi @rosbm, I have tested error
event and everything works correctly. I can simulate it as you write. Please try to update Total.js version to latest version.
Thank you!
Any news?
Hello.
I use: module FrameworkMail version 2.6.0.
When I use the "send" function and try to get data from a callback to display an error message nothing happens. :(
I specifically sent mail to a non-existent mailbox and did not receive a response about the error.
But not everything is so simple. The framework still gets information from the mail server that the error was and somewhere stores this information (caches).
This situation is observed when sending emails from Yandex.ru mail servers
When I send letters through the mail server mail.ru, then the framework returns a callback with all the contents (error) and for Yandex.ru mail servers and for mail servers mail.ru one-time, apparently from the cache.