Reza Rahemtola
Reza Rahemtola

Reputation: 1182

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

Upvotes: 1

Views: 118

Answers (2)

Reza Rahemtola
Reza Rahemtola

Reputation: 1182

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 <[email protected]>";

You can also check the docs about it.

Upvotes: 0

Scott Stensland
Scott Stensland

Reputation: 28285

You need to look at the dns hosting provider for your domain name ... like example.com ... assure you have added an MX Record Type ... it typically uses a value as

10  example.com

you can get a hint as to where your dns hosting is by issuing

dig  example.com  ns

to display its Name Server ( ns )

Upvotes: 1

Related Questions