title: Mail not sending locally in ROR
body: <p>I am trying to send mail locally but it doesn't send mail. What is actually happening....?</p>
  
  <h1>Contoller</h1>
  
  <pre><code>class ForestsController &lt; ApplicationController
    before_action :set_forest, only: [:show, :edit, :update, :destroy]
  
    # GET /forests
    # GET /forests.json
    def index
      @forests = Forest.all
    end
  
    # GET /forests/1
    # GET /forests/1.json
    def show
    end
  
    # GET /forests/new
    def new
      @forest = Forest.new
    end
  
    # POST /forests
    # POST /forests.json
    def create
      @forest = Forest.new(forest_params)
  
      respond_to do |format|
        if @forest.save
  
          UserMailer.welcome_user(@forest).deliver
  
          format.html { redirect_to @forest, notice: 'Your Message send successfully.' }
          format.json { render action: 'show', status: :created, location: @forest }
        else
          format.html { render action: 'new' }
          format.json { render json: @forest.errors, status: :unprocessable_entity }
        end
      end
    end
  
    private
      # Use callbacks to share common setup or constraints between actions.
      def set_forest
        @forest = Forest.find(params[:id])
      end
  
      # Never trust parameters from the scary internet, only allow the white list through.
      def forest_params
        params.require(:forest).permit(:name, :email, :phone, :body)
      end
  end
  </code></pre>
  
  <h1>UserMailer</h1>
  
  <pre><code>class UserMailer &lt; ActionMailer::Base
    default from: "tayyabzahid96@gmail.com"
  
    def welcome_user(forest)
      @forest = forest
      mail(to: @forest.email, subject: "Hello Man", body: @forest.body)
    end
  end
  </code></pre>
  
  <h1>View</h1>
  
  <pre><code>= form_for :forest, url:{:action =&gt;"create"}, html:{:class =&gt; "form-horizontal" } do |f|
    %div.form-group
      = f.label :name, 'Name', {:class =&gt; 'col-lg-2 control-label'} 
      %div.col-lg-3
        = f.text_field :name, {:class =&gt; 'form-control', :placeholder =&gt; "Your Name"}
    %div.form-group
      = f.label :email, 'Email', {:class =&gt; 'col-lg-2 control-label'}
      %div.col-lg-3
        = f.text_field :email, {:class =&gt; 'form-control', :placeholder =&gt; "someone@example.com"}
    %div.form-group
      = f.label :phone, 'Phone', {:class =&gt; 'col-lg-2 control-label'}
      %div.col-lg-3
        = f.text_field :phone, {:class =&gt; 'form-control', :placeholder =&gt; "Mobile No"}
    %div.form-group
      = f.label :body, 'Body', {:class =&gt; 'col-lg-2 control-label'}
      %div.col-lg-3
        = f.text_area :body, {:class =&gt; 'form-control', :placeholder =&gt; "Your Message"}
    %div.form-group
      %div.col-lg-offset-2.col-lg-10
        = f.submit :class =&gt; "btn btn-primary", :value =&gt; "Contact Us"
  </code></pre>
  
  <p>What is  happening....? Why does it not send mail...? I can't understand the problem.... Any suggestion about this that will be helpful for me......????</p>