Discussion Forums
- Topic List
- Most Recent Posts
- Sign In for more options
Hi, i'm trying to use ActionMailer to send some emails from rails, but here's the thing:
My server is running on localhost, i made the perfect configuration for ActionMailer properties...But, when i'm running on localhost, should that emails are sending correctly?Or they will be send only when i deploy the page for a real server?
Thanks
Mails can also be sent from localhost, if the localhost is in network having a server you should have correct settings for domain, address and port. If your localhost is a stanalone machine you can use gmail's smtp server setting for sending mail.
Jhimy: you can configure ActionMailer to perform_deliveries or not in an environment.rb file. Set it to deliver or not deliver depending on which environment you're running.
Something like this
if ENV['RAILS_ENV']!="production"
ActionMailer::Base.smtp_settings = {
....
} ActionMailer::Base.perform_deliveries = true
else
ActionMailer::Base.smtp_settings = {
....
} ActionMailer::Base.perform_deliveries = false
You can also set this property in the development.rb and production.rb files as follows, config.action_mailer.perform_deliveries = true or config.action_mailer.perform_deliveries = false Hope this helps!
