emailmeteorsmtpmeteor-accounts

Error when sending email with Accounts.sendVerificationEmail()


Thank you for reading my message, here is my problem : I recently started using email package, I defined MAIL_URL and sent emails with Email.send() successfully. But now I want to send verification emails and I got errors. Here is my code :

On server

Meteor.methods({
    'sendVerificationEmail'(){
        Accounts.sendVerificationEmail(Meteor.userId());
    }
});

On client

Meteor.call('sendVerificationEmail');

I got the following error : enter image description here With a few research I found this :

This message means that the email you sent was blocked by the recipient's email hosting server, and returned to you

I tried Accounts.sendVerificationEmail() with users who have different emails (gmail, disposable email, email of my personal website) and I always have the same error. The strange thing is that Email.send() works perfectly...

Thanks in advance for your help.

EDIT : The email address I'm using to send those emails is using the domain rezarahemtola.com Here is the result of dig rezarahemtola.com ns that Scott Stensland asked me to run in his answer : enter image description here


Solution

  • Posting the solution for anyone facing the same problem :

    As I said Email.send() was working correctly but got an error with Accounts.sendVerificationEmail, Accounts.sendResetPasswordEmail etc.

    Looks like Meteor can't retrieve automatically the sender address when using those methods, so you should set it like that :

    Accounts.emailTemplates.from = "Your_Name <your_email@example.com>";
    

    You can also check the docs about it.