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
<http://www.somelink.com/unsubscribe/#...@unsubscribe_code.code%7d%27%3eclick>
here to unsubscribe<\/a>"

    MassNotifier.delivery_method = :activerecord
    @recipients  = "#{recipients}"
    @from = "#{sender}<[email protected]>"
    @subject = "Check out the Review on #{company}"
    @body[:review_link] = "<a
href='http://www.somelink.com/company-review-rating/#{company.downcase.strip.squeeze("
<http://www.somelink.com/company-review-rating/#%7Bcompany.downcase.strip.squeeze%28%22>
").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.



-- 
Regards,
Santosh Turamari.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "ruby-on-rails-programming-with-passion" group.
To unsubscribe from this group, send email to
ruby-on-rails-programming-with-passion-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/ruby-on-rails-programming-with-passion?hl=en?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to