Action mailer SMTP google apps
It works now, I think the problem was with the username. it needs the domain in the username. i.e. the problem was
user_name: 'username'
Whereas the correct way (at least for google apps) is
user_name : 'username@mydomain.com'
ActionMailer - Sending email with Google Apps doesn't work, but works with free Gmail account
We had a similar issue. Try setting the domain to gmail.com
, like this:
config.action_mailer.smtp_settings = {
address: "smtp.gmail.com",
port: 587,
domain: "gmail.com",
user_name: "admin@devsup.com.br",
password: "password",
enable_starttls_auto: true,
authentication: "plain"
}
EDIT:
Or try to make sure to remove the typo in the domain. There is an extra single quote in your domain right now.
Rails 4 mailers with gmail smtp
Gmail smtp service need an APP PASSWORD for send a mail from a gmail account (for more info visit this link). After generating the password you must change the configuration of the development file:
config.action_mailer.perform_deliveries = true
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
:address => "smtp.gmail.com",
:port => 587,
:domain => "gmail.com",
:user_name => "mymail@gmail.com",
:password => "GENERATEDPASSWORD",
:authentication => :plain,
:enable_starttls_auto => true
}
And then restart the server.
For catching the error i've set: config.action_mailer.raise_delivery_errors = true
(Thanks Dipak for the tip)
Related Topics
Ruby Minitest Assert_Output Syntax
How to Define a Method in Ruby Using Splat and an Optional Hash at the Same Time
How to Make Rake Db:Migrate Generate Schema.Rb When Using :SQL Schema Format
Ruby: Automatically Set Instance Variable as Method Argument
Svg Files in Raphael, Can They Be Used
Ruby Spreadsheet Row Background Color
Accessing Module Methods with ::
Ruby: Syntax for Defining a Constant Inside a Struct
Conditional Page Caching [Solution: Conditional Fragment Caching]
Instance_Eval's Block Argument(S)- Documented? Purpose
Autoload Paths and Nested Services Classes Crash in Ruby
Upgrade Ruby on Elastic Beanstalk
What Could Be Causing This Rails Ioerror Closed Stream
Why Does the Break Statement in Ruby Behave Differently When Using Proc.New V. the Ampersand Sign
How to Make a Ruby Enumerator That Does Lazy Iteration Through Two Other Enumerators
Nesting Too Deep' Error While Retrieving JSON Using Httparty