I am getting this error while using action mailer to send mail via my gmail account.

> 
> Net::SMTPAuthenticationError in SweepstakesController#show
>  535-5.7.8 Username and Password not accepted.  
> 
>  Learn more at:
>  ParticipantMailer.winner\_confirmation(@result).deliver\_now!
> 
> 
> 

I have double checked my email and password,i have restarted my server,also i have gone through all previous questions related to this error here and implemented every answer but to no avail.
My development.rb file is:

```
config.action_mailer.default_url_options = { host: 'localhost', port:        3000}
ActionMailer::Base.delivery_method= :smtp
ActionMailer::Base.smtp_settings = {
  :address =>"smtp.gmail.com",
  :port => 587,
  :domain => "gmail.com",
  :user_name => "my_email@gmail.com",
  :password => "my_password",
  :authentication => 'plain',
  :openssl_verify_mode => 'none' 
}

```

Logic in controller:

```
def show
  @sweepstake = Sweepstake.find(params[:id])
  @participant = Participant.where(:sweepstake_id => @sweepstake.id )
  b = @sweepstake.winner_count
  @result = Array.new 
  b.times do 
    @result << @participant[rand(@participant.count)]
  end
  ParticipantMailer.winner_confirmation(@result).deliver_now!
end

```

participant\_mailer.rb file:

```
class ParticipantMailer < ApplicationMailer
  default from: 'rajesh010794@gmail.com'

  def winner_confirmation(result)
    @result = result
    @url  = 'http://example.com/login'

    Rails.logger.info(@result.inspect)
    @result.each do |i|
      mail(to: i.participant_email, subject: 'Congratulation')
    end
  end
end

```