1

登録コントローラーに次のコードがあります

def new

  Rails.logger.debug "#{params[:email]}"

  if !params[:email].blank? && !params[:invoke].blank? && params[:invoke].casecmp('Send') == 0
    MyMailer.send_email(params[:email]).deliver
   end 

end

私の params[:email] は正しく入力されます。

my_mailer.rb には次のコードがあります

class MyMailer < ActionMailer::Base

default from: 'someaddress@yahoo.com'

def send_email(emailaddress) 
@emailaddress=emailaddress
Rails.logger.debug "{#{emailaddress}}"
mail(to: @emailaddress ,subject: 'asdasd')
end
end

次のプロパティを設定しましたdevelopment.rb

config.action_mailer.raise_delivery_errors = true

  config.action_mailer.delivery_method = :smtp
  config.action_mailer.perform_deliveries = true

setup_mail.rb初期化子の下でsmtp構成も行いました

ActionMailer::Base.smtp_settings = {
    :address                => "smtp.yahoo.com",
    :port                   => 587,
    :domain                 => "yahoo.com",
    :user_name              => "someaddress@yahoo.com",
    :password               => "somepass",
    :authentication     => "plain",
    :enable_starttls_auto   => true
}

私のログは、メールがそれぞれの人に送信されたと言っていますが、私のgmailはメールが届いていないことを示しています。スパムでさえありません。見逃している構成設定はありますか?

4

0 に答える 0