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}<[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("
").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/.

--~--~---------~--~----~------------~-------~--~----~
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 [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to