I have a contact page form that is setup to send an email to a Gmail account. Only problem is it won't send. I believe I have narrowed the error down to my settings inside of the initializers directory.
These are my current settings for trying to setup a standard gmail account to send mail:
Could it be that my domain setting is wrong or should I be typing in [email protected]
for :user_name
? This is the first time I have used ActionMailer so I don't really know what I am doing. Can somebody please help me out!? Thanks!
Go to the config folder of your emails project and open environment. rb file and add the following line at the bottom of this file. It tells ActionMailer that you want to use the SMTP server. You can also set it to be :sendmail if you are using a Unix-based operating system such as Mac OS X or Linux.
Action Mailer allows you to send emails from your application using mailer classes and views. Mailers work very similarly to controllers. They inherit from ActionMailer::Base and live in app/mailers , and they have associated views that appear in app/views .
If you are using the development environment, change the development.rb to raise delivery errors, with config.action_mailer.raise_delivery_errors = true
Also, the problem might be that :user_name should be the entire email address ([email protected]), that's how Gmail authenticates users.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With