Search code examples
ruby-on-railsemailsmtpenvironment-variablesmailjet

Net::SMTPServerBusy Relay access denied Mailjet


I am receiving this error when trying to send Mailjet email from my production server:

Net::SMTPServerBusy (454 4.7.1 <email@example.com>: Relay access denied
)

Here is my config/initializers/mail.rb file:

ActionMailer::Base.delivery_method = :smtp
ActionMailer::Base.smtp_settings = {
:address        => 'in.mailjet.com',
:enable_starttls_auto => true,
:port           => 587,
:authentication => :plain,
:user_name      => ENV['MAILJET_USERNAME'],
:password       => ENV['MAILJET_PASSWORD'],
:domain         => 'example.com'
}

Any help is appreciated.


Solution

  • Thank you for using Mailjet !

    I would like to check one thing with you before moving on.

    Are talking of using :

    1. the API key as MAILJET_USERNAME ?
    2. the API secret as MAILJET_PASSWORD ?

    Some of our users are mixing them with login and password. The key and secret may be found in your account, under the REST API section.