Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- rails 3 email sending problem
- class UserMailer < ActionMailer::Base
- default :from => "user@gmail.com"
- def send_to(user)
- @user = user
- subject='welcome !'
- mail(:to=>'y.lan@gmail.com', :subject=>subject, :content_type => "text/html")
- mail.deliver
- end
- end
- def CarsController < BaseController
- ...
- def register_finish
- UserMailer.send_to(user)
- end
- end
- config.action_mailer.delivery_method = :smtp
- config.action_mailer.smtp_settings = {
- :address => "smtp.googlemail.com",
- :port => 532,
- :arguments => '-i'
- :enable_starttls_auto => true
- }
- config.action_mailer.perform_deliveries = true
- config.action_mailer.raise_delivery_errors = true
- ActionMailer::Base.delivery_method = :smtp
- ActionMailer::Base.smtp_settings = { ...}
- config.action_mailer.delivery_method = :smtp
- config.action_mailer.smtp_settings = {...}
- ActionMailer::Base.smtp_settings = {
- :address => "smtp.gmail.com",
- :port => 587,
- :domain => "domain.pl",
- :user_name => "username",
- :password => "password",
- :authentication => "plain",
- :enable_starttls_auto => true
- }
- ActionMailer::Base.delivery_method = :smtp
- ActionMailer::Base.smtp_settings = {
- :enable_starttls_auto => true,
- :address => 'smtp.gmail.com',
- :port => 587,
- :domain => 'your_domain',
- :authentication => :plain,
- :user_name => 'your_gmail_username',
- :password => 'your_gmail_password'
- }
- ActionMailer::Base.default_url_options[:host] = "localhost:3000"
Add Comment
Please, Sign In to add comment