Know when Email.send() is Completed or failed

Hey All,

I’m trying to send 100 emails as fast as possible. Following is my code

let sendEmail = function(emails, content) {
            let to = 'myemail@somewhercom';
            try {
                    to: to,
                    from: '',
                    subject: 'Testing here',
                    html: '<h1>Hello</h1>'
            } catch(e) {
                console.log(e, to);

And from my server method is as follows

campaign.sendEmails': function(campaignId, subscribers) {
            check(campaignId, String);
            check(subscribers, Array);

            for (var i = 100 - 1; i >= 0; i--) {
                console.log('hello, ', i);
                try {
                } catch (e) {
                    return e;

This is only testing code

I have no way to see if the Email.send has completed or not ?!?

Any thoughts guys ?

1 Like

The actual process of sending the email is not handled by Meteor / Node but by something like sendmail.

Thus, to determine whether you successfully sent an e-mail, you’d have to parse the logs in /var/log/.

Which, by the way, you shouldn’t bother with. Make sure that you can send emails and that your server is correctly configured so that they can arrive in a user’s inbox (and not in the spam folder). And that’s it.

Try removing the Meteor.bindEnvironment bit and see if it still works. Meteor.setTimeout should automatically give you a Meteor environment.