Santosh Turamari
2009-Apr-23 06:30 UTC
how to avoid (Net::SMTPFatalError) "555 5.5.2 Syntax error
Hi all, I have written code to send mails through action_mailer, where in I called MassNotifier.deliver_forward_review_link(current_user.profile.display_name,email,params[:notification][:message],params[:title],params[:designation],params[:company],params[:id],@invitation.invitation_code) this method , and in mass_notifier.rb I fave written def forward_review_link(sender,recipients,message,title,designation,company,id,code) return if UnsubscribedEmail.find_by_email(recipients) @unsubscribe_code = MailingList.find_or_create_by_email(recipients) if @unsubscribe_code.code.nil? @unsubscribe_code.code = Digest::SHA1.hexdigest( Time.now.to_s.split(//).sort_by {rand}.join ) @unsubscribe_code.save end @body[:unsubscribe_link] = "<a href=''http://www.somelink.com/unsubscribe/#{@unsubscribe_code.code}''>click here to unsubscribe<\/a>" MassNotifier.delivery_method = :activerecord @recipients = "#{recipients}" @from = "#{sender}<aaa-hTYexaC8S7c@public.gmane.org>" @subject = "Check out the Review on #{company}" @body[:review_link] = "<a href=''http://www.somelink.com/company-review-rating/#{company.downcase.strip.squeeze(" ").gsub(/[^[:alnum:]]/,''-'').squeeze("-").chomp("-")}/#{designation.strip.squeeze(" ").gsub(/[^[:alnum:]]/,''-'').squeeze("-").chomp("-")}/#{id}''>clck here<\/a>" @body[:company_name] = "#{company}" @body[:sender_name] = "#{sender}" content_type "text/html" end If I submit an email id, It is giving error as (Net::SMTPFatalError) "555 5.5.2 Syntax error. d29sm1994943and.38\n" How to avoid this error Please help me its urgent. -- Posted via http://www.ruby-forum.com/.
Chris Schumann
2009-Jul-31 12:26 UTC
Re: how to avoid (Net::SMTPFatalError) "555 5.5.2 Syntax error
Santosh Turamari wrote:> @from = "#{sender}<aaa-hTYexaC8S7c@public.gmane.org>"> If I submit an email id, It is giving error as > (Net::SMTPFatalError) "555 5.5.2 Syntax error. d29sm1994943and.38\n"The from line is the problem. The Net::SMTP library was recently changed so it adds angle brackets to your sender, so you cannot have any in your string. Try this as a workaround: @from = "aaa-hTYexaC8S7c@public.gmane.org" -- Posted via http://www.ruby-forum.com/.
makevoid
2009-Aug-24 12:45 UTC
Re: how to avoid (Net::SMTPFatalError) "555 5.5.2 Syntax error
Hi Chris, the workaround solved the problem, thank you! Is there another way to display a name with the email address without using angle brackets ? Thanks! On Jul 31, 2:26 pm, Chris Schumann <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Santosh Turamari wrote: > > @from = "#{sender}<a...-hTYexaC8S7c@public.gmane.org>" > > If I submit an email id, It is giving error as > > (Net::SMTPFatalError) "555 5.5.2 Syntax error. d29sm1994943and.38\n" > > The from line is the problem. The Net::SMTP library was recently changed > so it adds angle brackets to your sender, so you cannot have any in your > string. Try this as a workaround: > > @from = "a...-hTYexaC8S7c@public.gmane.org" > -- > Posted viahttp://www.ruby-forum.com/.
Chris Schumann
2009-Aug-24 15:05 UTC
Re: how to avoid (Net::SMTPFatalError) "555 5.5.2 Syntax error
Francesco Canessa wrote:> Hi Chris, > > the workaround solved the problem, thank you! > > Is there another way to display a name with the email address without > using angle brackets ? > > Thanks! > > On Jul 31, 2:26�pm, Chris Schumann <rails-mailing-l...@andreas-s.net>Display? Sure. Do anything you want. But as of Rails 2.3.3, the from email address will get the angle brackets added, so it can only contain the address. Rails 2.3.4 is/was supposed to fix that, and includes tests so it will be ensured in future versions. -- Posted via http://www.ruby-forum.com/.
Shan Huang
2009-Aug-28 22:30 UTC
Re: how to avoid (Net::SMTPFatalError) "555 5.5.2 Syntax error
Thank you so much, I had the same problem and it worked. On Jul 31, 2:26 pm, Chris Schumann <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Santosh Turamari wrote: > > @from = "#{sender}<a...-hTYexaC8S7c@public.gmane.org>" > > If I submit an email id, It is giving error as > > (Net::SMTPFatalError) "555 5.5.2 Syntax error. d29sm1994943and.38\n" > > The from line is the problem. The Net::SMTP library was recently changed > so it adds angle brackets to your sender, so you cannot have any in your > string. Try this as a workaround: > > @from = "a...-hTYexaC8S7c@public.gmane.org" > -- > Posted viahttp://www.ruby-forum.com/.
Aslam Syed
2009-Sep-01 12:25 UTC
Re: how to avoid (Net::SMTPFatalError) "555 5.5.2 Syntax error
Hello all, I am trying to send email and written code like this: <code> def matches_for_request( contact, req, matching_offers ) recipients "#{contact}" from "gaadishare-iXKsd+nNOz8xFYw1CcD5bw@public.gmane.org" subject "Matches found for your request" sent_on Time.now body[:offers] = matching_offers end </code> I also had put angled brackets in the from address like "<gaadishare-iXKsd+nNOz8xFYw1CcD5bw@public.gmane.org>". However, as Chris''s reply suggets I tried removing the angled brackets. But, this did not solve my problem. I am continuing to get the following error message: 555 5.5.2 Syntax error. 23sm387874pxi.9 Please help. -- Posted via http://www.ruby-forum.com/.
Bruno Brunagh
2009-Sep-18 10:50 UTC
Re: how to avoid (Net::SMTPFatalError) "555 5.5.2 Syntax error
Aslam Syed wrote:> Hello all, > > I am trying to send email and written code like this: > > <code> > def matches_for_request( contact, req, matching_offers ) > recipients "#{contact}" > from "gaadishare-iXKsd+nNOz8xFYw1CcD5bw@public.gmane.org" > subject "Matches found for your request" > sent_on Time.now > > body[:offers] = matching_offers > end > </code> > > I also had put angled brackets in the from address like > "<gaadishare-iXKsd+nNOz8xFYw1CcD5bw@public.gmane.org>". However, as Chris''s reply suggets I tried > removing the angled brackets. But, this did not solve my problem. I am > continuing to get the following error message: > > 555 5.5.2 Syntax error. 23sm387874pxi.9 > > Please help.Hi all, I have the same issue: Net::SMTPFatalError 555 using rails 2.3.3 under development environment I both tried with or without angle brackets in the @from parameter, but with no help. Any idea? Thanks -- Posted via http://www.ruby-forum.com/.
Nimesh Nikum
2010-Jun-17 09:15 UTC
Re: how to avoid (Net::SMTPFatalError) "555 5.5.2 Syntax error
Try to do like this: from "Monaqasat <noreply-xLnaQW9NNNTby3iVrkZq2A@public.gmane.org>" headers "return-path" => ''noreply-xLnaQW9NNNTby3iVrkZq2A@public.gmane.org'' It worked for me !!! Thanks, Nimesh Nikum Karim Helal wrote:> Any updates on how we can send a @from with a name before the email > address? > > I want to be able to send emails using the noreply-xLnaQW9NNNTby3iVrkZq2A@public.gmane.org email > address but show ''Monaqasat'' as the name of the sender. > > Thx. > > .Karim > > Bruno Brunagh wrote: >> Aslam Syed wrote: >>> Hello all, >>> >>> I am trying to send email and written code like this: >>> >>> <code> >>> def matches_for_request( contact, req, matching_offers ) >>> recipients "#{contact}" >>> from "gaadishare-iXKsd+nNOz8xFYw1CcD5bw@public.gmane.org" >>> subject "Matches found for your request" >>> sent_on Time.now >>> >>> body[:offers] = matching_offers >>> end >>> </code> >>> >>> I also had put angled brackets in the from address like >>> "<gaadishare-iXKsd+nNOz8xFYw1CcD5bw@public.gmane.org>". However, as Chris''s reply suggets I tried >>> removing the angled brackets. But, this did not solve my problem. I am >>> continuing to get the following error message: >>> >>> 555 5.5.2 Syntax error. 23sm387874pxi.9 >>> >>> Please help. >> >> >> Hi all, >> I have the same issue: >> Net::SMTPFatalError 555 using rails 2.3.3 >> under development environment >> >> I both tried with or without angle brackets in the @from parameter, >> but with no help. >> >> Any idea? >> >> Thanks-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
kannav rajeev
2010-Jun-17 10:06 UTC
Re: Re: how to avoid (Net::SMTPFatalError) "555 5.5.2 Syntax error
use action mailer optional tls http://douglasfshearer.com/blog/gmail-smtp-with-ruby-on-rails-and-actionmailer On Thu, Jun 17, 2010 at 2:45 PM, Nimesh Nikum <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Try to do like this: > from "Monaqasat <noreply-xLnaQW9NNNTby3iVrkZq2A@public.gmane.org>" > headers "return-path" => ''noreply-xLnaQW9NNNTby3iVrkZq2A@public.gmane.org'' > > It worked for me !!! > > Thanks, > Nimesh Nikum > > Karim Helal wrote: > > Any updates on how we can send a @from with a name before the email > > address? > > > > I want to be able to send emails using the noreply-xLnaQW9NNNTby3iVrkZq2A@public.gmane.org email > > address but show ''Monaqasat'' as the name of the sender. > > > > Thx. > > > > .Karim > > > > Bruno Brunagh wrote: > >> Aslam Syed wrote: > >>> Hello all, > >>> > >>> I am trying to send email and written code like this: > >>> > >>> <code> > >>> def matches_for_request( contact, req, matching_offers ) > >>> recipients "#{contact}" > >>> from "gaadishare-iXKsd+nNOz8xFYw1CcD5bw@public.gmane.org" > >>> subject "Matches found for your request" > >>> sent_on Time.now > >>> > >>> body[:offers] = matching_offers > >>> end > >>> </code> > >>> > >>> I also had put angled brackets in the from address like > >>> "<gaadishare-iXKsd+nNOz8xFYw1CcD5bw@public.gmane.org>". However, as Chris''s reply suggets I tried > >>> removing the angled brackets. But, this did not solve my problem. I am > >>> continuing to get the following error message: > >>> > >>> 555 5.5.2 Syntax error. 23sm387874pxi.9 > >>> > >>> Please help. > >> > >> > >> Hi all, > >> I have the same issue: > >> Net::SMTPFatalError 555 using rails 2.3.3 > >> under development environment > >> > >> I both tried with or without angle brackets in the @from parameter, > >> but with no help. > >> > >> Any idea? > >> > >> Thanks > > -- > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> > . > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > >-- Thanks: Rajeev sharma -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.