Re: Email section

Manish Belsare
Fri, 12 Mar 2010 17:00:14 -0000

class EmailController < ApplicationController

include ProfileHelper
before_filter :protect, :only => [ "correspond" ]

  def remind
  @title = "Mail me my login information"
  if param_posted?(:user)
      email = params[:user][:email]
       user = User.find_by_email(email)
       if user
        UserMailer.deliver_reminder(user)
          flash[:notice] = "Login information was sent."
          redirect_to :action => "index", :controller =>
"site"
         else
         flash[:notice] = "There is no user with that email address."
       end
    end
  end

 def email_sent


MyMailer::deliver_mail("recipient.address-hcDgGtZH8xNBDgjK7y7TUQ@public.gmane.org")

  end

  def correspond
    user = User.find(session[:user_id])

    id=session[:user_id]
     Personal.find_each do |@per|
        if(@per.user_id == id)           # id is user id
          @per_id = "#{@per.id}"        #que_id is question_id
          break
        end
     end
     idd=@per_id
     #flash[:notice] = idd
     iddd=idd.to_i


    recipient = User.find_by_user_name(params[:id])

    @title = "Email: #{@per.first_name} #{@per.last_name}
(#{user.user_name})   ::   Recipient: #{recipient.user_name}"
    if param_posted?(:message)
      @message = Message.new(params[:message])
      if @message.valid?
        UserMailer.deliver_message(
          :user => user,
          :recipient => recipient,
          :message => @message,
          :user_url => profile_for(user),
          :reply_url => url_for(:action => "correspond",
                                :id => user.user_name)
        )
        flash[:notice] = "Email sent."
        redirect_to profile_for(recipient)
      end
    end
  end

end


ya diz is the code for email_controller....
Can u please tell me what is the problem that the email is not being
sent?