SMTP setting for rails3and put new gmail.rb then run.
require 'rubygems'
require 'action_mailer'
require 'tlsmail'
Net::SMTP.enable_tls(OpenSSL::SSL::VERIFY_NONE)
ActionMailer::Base.delivery_method = :smtp
ActionMailer::Base.perform_deliveries = true
ActionMailer::Base.default_charset = "utf-8"
ActionMailer::Base.raise_delivery_errors = true
ActionMailer::Base.smtp_settings = {
:enable_starttls_auto => true,
:address => "smtp.gmail.com",
:port => 587,
:domain => "domainname",
:authentication => :plain,
:user_name => "notifications@domainname",
:password => "password"
}
class Emailer < ActionMailer::Base
def test_email()
subject "Test message"
from "Test mail"
recipients 'recipients@domainname.com'
body "Test mail for gmail SMTP setting"
end
end
Emailer.deliver_test_email()
require 'rubygems'
require 'action_mailer'
require 'tlsmail'
Net::SMTP.enable_tls(OpenSSL::SSL::VERIFY_NONE)
ActionMailer::Base.delivery_method = :smtp
ActionMailer::Base.perform_deliveries = true
ActionMailer::Base.default_charset = "utf-8"
ActionMailer::Base.raise_delivery_errors = true
ActionMailer::Base.smtp_settings = {
:enable_starttls_auto => true,
:address => "smtp.gmail.com",
:port => 587,
:domain => "domainname",
:authentication => :plain,
:user_name => "notifications@domainname",
:password => "password"
}
class Emailer < ActionMailer::Base
def test_email()
subject "Test message"
from "Test mail"
recipients 'recipients@domainname.com'
body "Test mail for gmail SMTP setting"
end
end
Emailer.deliver_test_email()
No comments:
Post a Comment