Rails devise with gmail errorsA concise explanation of nil v. empty v. blank in Ruby on RailsUnderstanding the Rails Authenticity TokenHow can I rename a database column in a Ruby on Rails migration?How do I get the current absolute URL in Ruby on Rails?Devise Not Sending MailNo route matches “/users/sign_out” devise rails 3Rails Mailer is not actually sending emailsAngular Rails Devise Override Controller1 error prohibited this user from being saved: Reset password token is invalidRails w/devise authentication what is the configuration of iRedMail?
Marrying a second woman behind your wife's back: is it wrong and can Quran/Hadith prove this?
How acidic does a mixture have to be for milk to curdle?
How can I create a pattern of parallel lines that are increasing in distance in Photoshop / Illustrator?
What is the difference between 1/3, 1/2, and full casters?
Why are so many countries still in the Commonwealth?
Can the 2019 UA Artificer's Returning Weapon and Radiant Weapon infusions stack on the same weapon?
Convert a string like 4h53m12s to a total number of seconds in JavaScript
Why was Sauron preparing for war instead of trying to find the ring?
kids pooling money for Lego League and taxes
What is "I bet" in German?
How do I generate distribution of positive numbers only with min, max and mean?
Trapped in an ocean Temple in Minecraft?
Send a single HTML email from Thunderbird, overriding the default "plain text" setting
How to deal with a player who makes bad characters and kills them?
Print sums of all subsets
Spin vs orbital angular momenta in QFT
Giant space birds hatching out of planets; short story
Why didn't Britain or any other European power colonise Abyssinia/Ethiopia before 1936?
How to judge a Ph.D. applicant that arrives "out of thin air"
Is it normal practice to screen share with a client?
Keeping an "hot eyeball planet" wet
How do I stop my characters falling in love?
Can two figures have the same area, perimeter, and same number of segments have different shape?
What does コテッと mean?
Rails devise with gmail errors
A concise explanation of nil v. empty v. blank in Ruby on RailsUnderstanding the Rails Authenticity TokenHow can I rename a database column in a Ruby on Rails migration?How do I get the current absolute URL in Ruby on Rails?Devise Not Sending MailNo route matches “/users/sign_out” devise rails 3Rails Mailer is not actually sending emailsAngular Rails Devise Override Controller1 error prohibited this user from being saved: Reset password token is invalidRails w/devise authentication what is the configuration of iRedMail?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I'm currently working on an application with a mailer system. It was working fine, sending a welcome email and sending instructions to reset password, but now and only when I try to send reset instructions I have this error.
ArgumentError (SMTP From address may not be blank: nil):
I'm using a custom domain like so noreply@mycustomdomain.com
And here is my configuration
development.rb
config.action_mailer.raise_delivery_errors = true
config.action_mailer.perform_caching = false
config.action_mailer.default_url_options = host: 'localhost:3000'
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings =
address: 'smtp.gmail.com',
port: '587',
domain: 'gmail.com',
authentication: :plain,
enable_starttls_auto: true,
user_name: Rails.application.secrets.mailer_username,
password: Rails.application.secrets.mailer_password
Any idea ?
Edit
class UserMailer < ApplicationMailer
default from: 'noreply@mycustomdomain.com'
def welcome_email(user)
@user = user
@url = 'http://localhost:3000/users/sign_in'
mail(to: @user.email, subject: 'Bienvenue')
end
def generate_new_password_email
user = User.find(params[:user_id])
user.send_reset_password_instructions
end
def reset_password; end
end
ruby-on-rails devise actionmailer
add a comment |
I'm currently working on an application with a mailer system. It was working fine, sending a welcome email and sending instructions to reset password, but now and only when I try to send reset instructions I have this error.
ArgumentError (SMTP From address may not be blank: nil):
I'm using a custom domain like so noreply@mycustomdomain.com
And here is my configuration
development.rb
config.action_mailer.raise_delivery_errors = true
config.action_mailer.perform_caching = false
config.action_mailer.default_url_options = host: 'localhost:3000'
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings =
address: 'smtp.gmail.com',
port: '587',
domain: 'gmail.com',
authentication: :plain,
enable_starttls_auto: true,
user_name: Rails.application.secrets.mailer_username,
password: Rails.application.secrets.mailer_password
Any idea ?
Edit
class UserMailer < ApplicationMailer
default from: 'noreply@mycustomdomain.com'
def welcome_email(user)
@user = user
@url = 'http://localhost:3000/users/sign_in'
mail(to: @user.email, subject: 'Bienvenue')
end
def generate_new_password_email
user = User.find(params[:user_id])
user.send_reset_password_instructions
end
def reset_password; end
end
ruby-on-rails devise actionmailer
add a comment |
I'm currently working on an application with a mailer system. It was working fine, sending a welcome email and sending instructions to reset password, but now and only when I try to send reset instructions I have this error.
ArgumentError (SMTP From address may not be blank: nil):
I'm using a custom domain like so noreply@mycustomdomain.com
And here is my configuration
development.rb
config.action_mailer.raise_delivery_errors = true
config.action_mailer.perform_caching = false
config.action_mailer.default_url_options = host: 'localhost:3000'
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings =
address: 'smtp.gmail.com',
port: '587',
domain: 'gmail.com',
authentication: :plain,
enable_starttls_auto: true,
user_name: Rails.application.secrets.mailer_username,
password: Rails.application.secrets.mailer_password
Any idea ?
Edit
class UserMailer < ApplicationMailer
default from: 'noreply@mycustomdomain.com'
def welcome_email(user)
@user = user
@url = 'http://localhost:3000/users/sign_in'
mail(to: @user.email, subject: 'Bienvenue')
end
def generate_new_password_email
user = User.find(params[:user_id])
user.send_reset_password_instructions
end
def reset_password; end
end
ruby-on-rails devise actionmailer
I'm currently working on an application with a mailer system. It was working fine, sending a welcome email and sending instructions to reset password, but now and only when I try to send reset instructions I have this error.
ArgumentError (SMTP From address may not be blank: nil):
I'm using a custom domain like so noreply@mycustomdomain.com
And here is my configuration
development.rb
config.action_mailer.raise_delivery_errors = true
config.action_mailer.perform_caching = false
config.action_mailer.default_url_options = host: 'localhost:3000'
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings =
address: 'smtp.gmail.com',
port: '587',
domain: 'gmail.com',
authentication: :plain,
enable_starttls_auto: true,
user_name: Rails.application.secrets.mailer_username,
password: Rails.application.secrets.mailer_password
Any idea ?
Edit
class UserMailer < ApplicationMailer
default from: 'noreply@mycustomdomain.com'
def welcome_email(user)
@user = user
@url = 'http://localhost:3000/users/sign_in'
mail(to: @user.email, subject: 'Bienvenue')
end
def generate_new_password_email
user = User.find(params[:user_id])
user.send_reset_password_instructions
end
def reset_password; end
end
ruby-on-rails devise actionmailer
ruby-on-rails devise actionmailer
edited Jul 11 '17 at 8:07
Manspider
asked Jul 10 '17 at 14:19
ManspiderManspider
1151 silver badge12 bronze badges
1151 silver badge12 bronze badges
add a comment |
add a comment |
5 Answers
5
active
oldest
votes
I had the same problem, and the reason behind that was i working in development but my mailer was searching the smtp_settings in the production, so to solve the issue you can change the mailer settings or you can copy the same smtp_settings into production.
Pretty much how I fixed it if I remember correctly
– Manspider
Mar 23 '18 at 0:50
add a comment |
In devise.rb config.mailer_sender = 'please-change-me-at-config-initializers-devise@example.com' had been commented.
Config.mailer_sender was never initialized and so always nil even if I set it with default from:
add a comment |
It looks like you don't have a From header in your email. A good practice would be to put the following line into your ApplicationMailer:
class ApplicationMailer
default from: 'noreply@mycustomdomain.com'
# ...
end
To override this in your inheriting mailers, simply declare the same statement. To override it in individual mail methods, put it into the mail call like so:
def new_message(user, message)
mail(
to: user.email,
subject: "New message from #message.sender.name",
from: message.sender.email
)
end
Hope that helps
I do have adefault fromset to the correct address in my mailer. Also the mail is send by Devise as it is a mail to reset a password. It worked for a time without having to override anything so the problem is somewhere else maybe.
– Manspider
Jul 11 '17 at 7:50
@LRP it's in devise.rb. Need something like this: config.mailer_sender = ENV['SMTP_USERNAME']
– Ka Mok
Jan 23 '18 at 5:14
add a comment |
You could try setting :from in your config, using the default_option like this,
config.action_mailer.default_options = from: 'noreply@mycustomdomain.com'
this is 10 months old
– Manspider
May 31 '18 at 6:00
add a comment |
I stumbled upon the same problem. My solution was, I edited config/initializers/devise.rb changed a line from config.mailer_sender = 'please-change-me-at-config-initializers-devise@example.com' to config.mailer_sender = ENV["default_from_email"]
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f45014520%2frails-devise-with-gmail-errors%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
5 Answers
5
active
oldest
votes
5 Answers
5
active
oldest
votes
active
oldest
votes
active
oldest
votes
I had the same problem, and the reason behind that was i working in development but my mailer was searching the smtp_settings in the production, so to solve the issue you can change the mailer settings or you can copy the same smtp_settings into production.
Pretty much how I fixed it if I remember correctly
– Manspider
Mar 23 '18 at 0:50
add a comment |
I had the same problem, and the reason behind that was i working in development but my mailer was searching the smtp_settings in the production, so to solve the issue you can change the mailer settings or you can copy the same smtp_settings into production.
Pretty much how I fixed it if I remember correctly
– Manspider
Mar 23 '18 at 0:50
add a comment |
I had the same problem, and the reason behind that was i working in development but my mailer was searching the smtp_settings in the production, so to solve the issue you can change the mailer settings or you can copy the same smtp_settings into production.
I had the same problem, and the reason behind that was i working in development but my mailer was searching the smtp_settings in the production, so to solve the issue you can change the mailer settings or you can copy the same smtp_settings into production.
answered Mar 22 '18 at 8:16
Somesh SharmaSomesh Sharma
1596 bronze badges
1596 bronze badges
Pretty much how I fixed it if I remember correctly
– Manspider
Mar 23 '18 at 0:50
add a comment |
Pretty much how I fixed it if I remember correctly
– Manspider
Mar 23 '18 at 0:50
Pretty much how I fixed it if I remember correctly
– Manspider
Mar 23 '18 at 0:50
Pretty much how I fixed it if I remember correctly
– Manspider
Mar 23 '18 at 0:50
add a comment |
In devise.rb config.mailer_sender = 'please-change-me-at-config-initializers-devise@example.com' had been commented.
Config.mailer_sender was never initialized and so always nil even if I set it with default from:
add a comment |
In devise.rb config.mailer_sender = 'please-change-me-at-config-initializers-devise@example.com' had been commented.
Config.mailer_sender was never initialized and so always nil even if I set it with default from:
add a comment |
In devise.rb config.mailer_sender = 'please-change-me-at-config-initializers-devise@example.com' had been commented.
Config.mailer_sender was never initialized and so always nil even if I set it with default from:
In devise.rb config.mailer_sender = 'please-change-me-at-config-initializers-devise@example.com' had been commented.
Config.mailer_sender was never initialized and so always nil even if I set it with default from:
answered Jul 11 '17 at 8:40
ManspiderManspider
1151 silver badge12 bronze badges
1151 silver badge12 bronze badges
add a comment |
add a comment |
It looks like you don't have a From header in your email. A good practice would be to put the following line into your ApplicationMailer:
class ApplicationMailer
default from: 'noreply@mycustomdomain.com'
# ...
end
To override this in your inheriting mailers, simply declare the same statement. To override it in individual mail methods, put it into the mail call like so:
def new_message(user, message)
mail(
to: user.email,
subject: "New message from #message.sender.name",
from: message.sender.email
)
end
Hope that helps
I do have adefault fromset to the correct address in my mailer. Also the mail is send by Devise as it is a mail to reset a password. It worked for a time without having to override anything so the problem is somewhere else maybe.
– Manspider
Jul 11 '17 at 7:50
@LRP it's in devise.rb. Need something like this: config.mailer_sender = ENV['SMTP_USERNAME']
– Ka Mok
Jan 23 '18 at 5:14
add a comment |
It looks like you don't have a From header in your email. A good practice would be to put the following line into your ApplicationMailer:
class ApplicationMailer
default from: 'noreply@mycustomdomain.com'
# ...
end
To override this in your inheriting mailers, simply declare the same statement. To override it in individual mail methods, put it into the mail call like so:
def new_message(user, message)
mail(
to: user.email,
subject: "New message from #message.sender.name",
from: message.sender.email
)
end
Hope that helps
I do have adefault fromset to the correct address in my mailer. Also the mail is send by Devise as it is a mail to reset a password. It worked for a time without having to override anything so the problem is somewhere else maybe.
– Manspider
Jul 11 '17 at 7:50
@LRP it's in devise.rb. Need something like this: config.mailer_sender = ENV['SMTP_USERNAME']
– Ka Mok
Jan 23 '18 at 5:14
add a comment |
It looks like you don't have a From header in your email. A good practice would be to put the following line into your ApplicationMailer:
class ApplicationMailer
default from: 'noreply@mycustomdomain.com'
# ...
end
To override this in your inheriting mailers, simply declare the same statement. To override it in individual mail methods, put it into the mail call like so:
def new_message(user, message)
mail(
to: user.email,
subject: "New message from #message.sender.name",
from: message.sender.email
)
end
Hope that helps
It looks like you don't have a From header in your email. A good practice would be to put the following line into your ApplicationMailer:
class ApplicationMailer
default from: 'noreply@mycustomdomain.com'
# ...
end
To override this in your inheriting mailers, simply declare the same statement. To override it in individual mail methods, put it into the mail call like so:
def new_message(user, message)
mail(
to: user.email,
subject: "New message from #message.sender.name",
from: message.sender.email
)
end
Hope that helps
answered Jul 10 '17 at 14:40
Clemens KoflerClemens Kofler
3391 silver badge8 bronze badges
3391 silver badge8 bronze badges
I do have adefault fromset to the correct address in my mailer. Also the mail is send by Devise as it is a mail to reset a password. It worked for a time without having to override anything so the problem is somewhere else maybe.
– Manspider
Jul 11 '17 at 7:50
@LRP it's in devise.rb. Need something like this: config.mailer_sender = ENV['SMTP_USERNAME']
– Ka Mok
Jan 23 '18 at 5:14
add a comment |
I do have adefault fromset to the correct address in my mailer. Also the mail is send by Devise as it is a mail to reset a password. It worked for a time without having to override anything so the problem is somewhere else maybe.
– Manspider
Jul 11 '17 at 7:50
@LRP it's in devise.rb. Need something like this: config.mailer_sender = ENV['SMTP_USERNAME']
– Ka Mok
Jan 23 '18 at 5:14
I do have a
default from set to the correct address in my mailer. Also the mail is send by Devise as it is a mail to reset a password. It worked for a time without having to override anything so the problem is somewhere else maybe.– Manspider
Jul 11 '17 at 7:50
I do have a
default from set to the correct address in my mailer. Also the mail is send by Devise as it is a mail to reset a password. It worked for a time without having to override anything so the problem is somewhere else maybe.– Manspider
Jul 11 '17 at 7:50
@LRP it's in devise.rb. Need something like this: config.mailer_sender = ENV['SMTP_USERNAME']
– Ka Mok
Jan 23 '18 at 5:14
@LRP it's in devise.rb. Need something like this: config.mailer_sender = ENV['SMTP_USERNAME']
– Ka Mok
Jan 23 '18 at 5:14
add a comment |
You could try setting :from in your config, using the default_option like this,
config.action_mailer.default_options = from: 'noreply@mycustomdomain.com'
this is 10 months old
– Manspider
May 31 '18 at 6:00
add a comment |
You could try setting :from in your config, using the default_option like this,
config.action_mailer.default_options = from: 'noreply@mycustomdomain.com'
this is 10 months old
– Manspider
May 31 '18 at 6:00
add a comment |
You could try setting :from in your config, using the default_option like this,
config.action_mailer.default_options = from: 'noreply@mycustomdomain.com'
You could try setting :from in your config, using the default_option like this,
config.action_mailer.default_options = from: 'noreply@mycustomdomain.com'
edited May 31 '18 at 5:02
A J
3,02710 gold badges30 silver badges44 bronze badges
3,02710 gold badges30 silver badges44 bronze badges
answered May 31 '18 at 5:01
MonRMonR
211 bronze badge
211 bronze badge
this is 10 months old
– Manspider
May 31 '18 at 6:00
add a comment |
this is 10 months old
– Manspider
May 31 '18 at 6:00
this is 10 months old
– Manspider
May 31 '18 at 6:00
this is 10 months old
– Manspider
May 31 '18 at 6:00
add a comment |
I stumbled upon the same problem. My solution was, I edited config/initializers/devise.rb changed a line from config.mailer_sender = 'please-change-me-at-config-initializers-devise@example.com' to config.mailer_sender = ENV["default_from_email"]
add a comment |
I stumbled upon the same problem. My solution was, I edited config/initializers/devise.rb changed a line from config.mailer_sender = 'please-change-me-at-config-initializers-devise@example.com' to config.mailer_sender = ENV["default_from_email"]
add a comment |
I stumbled upon the same problem. My solution was, I edited config/initializers/devise.rb changed a line from config.mailer_sender = 'please-change-me-at-config-initializers-devise@example.com' to config.mailer_sender = ENV["default_from_email"]
I stumbled upon the same problem. My solution was, I edited config/initializers/devise.rb changed a line from config.mailer_sender = 'please-change-me-at-config-initializers-devise@example.com' to config.mailer_sender = ENV["default_from_email"]
answered Mar 26 at 17:32
gsumkgsumk
667 bronze badges
667 bronze badges
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f45014520%2frails-devise-with-gmail-errors%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown