Nurzed Lkham
2009-Mar-27 06:18 UTC
ActionMailer not send email and not generate error in log
hello guys.. i was trying configuring SMTP with GMail n my rails appliaction. when running everything seems alright but the mails not getting delivered. also the logs show the action as successful . in environment.rb: ActionMailer::Base.delivery_method =:smtp ActionMailer::Base.smtp_settings = { :address => "smtp.gmail.com", :port => "587", :domain => "mydomain.com", :authentication => :plain, :user_name => "my_gmail_account", :password => "my_password" } Emailer controller : class EmailerController < ApplicationController def sendmail recipient = params[:email][:recipient] subject = params[:email][:subject] message = params[:email][:message] Emailer.deliver_contact(recipient, subject, message) return if request.xhr? render :text => ''Message sent successfully'' end def index render :file => ''app/views/emailer/index.html.erb'' end end View : <h1>Send Email</h1> <% form_tag :action => ''sendmail'' do %> <p><label for="email_subject">Subject</label>: <%= text_field ''email'', ''subject'' %></p> <p><label for="email_recipient">Recipient</label>: <%= text_field ''email'', ''recipient'' %></p> <p><label for="email_message">Message</label><br/> <%= text_area ''email'', ''message'' %></p> <%= submit_tag "Send" %> <% end %> please help me out and point out the details. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Greg Donald
2009-Mar-27 21:03 UTC
Re: ActionMailer not send email and not generate error in log
On Fri, Mar 27, 2009 at 1:18 AM, Nurzed Lkham <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > hello guys.. i was trying configuring SMTP with GMail n my rails > appliaction. when running everything seems alright but the mails not > getting delivered. also the logs show the action as successful . > > in environment.rb: > > ActionMailer::Base.delivery_method =:smtp > ActionMailer::Base.smtp_settings = { > :address => "smtp.gmail.com", > :port => "587", > :domain => "mydomain.com", > :authentication => :plain, > :user_name => "my_gmail_account", > :password => "my_password" > }How are you providing sasl_auth support in this setup? GMail requires it for smtp use. I usually setup my actual smtp server for use with GMail, something like this for example: http://bookmarks.honewatson.com/2008/04/20/postfix-gmail-smtp-relay/ -- Greg Donald http://destiney.com/ --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---