이 메일 "에서"에서하지 설정 SMTP 사용자 이름에서 보내는 얻는다 ActionMailer의 방법은 user_mailer.rb에서
class UserMailer < ActionMailer::Base
default from: "[email protected]"
def approved_mail(user)
@user = user
@greeting = "Hi"
mail to: @user.email
end
end
그리고 development.rb에서
이config.action_mailer.smtp_settings = {
address: "smtp.gmail.com",
port: 587,
domain: "gmail.com",
authentication: "plain",
enable_starttls_auto: true,
user_name: "[email protected]",
password: ENV["GMAIL_PASSWORD"]
}
내가 email.2 "에서 이메일을 레일 @ gmail.com "왜"[email protected] "에서 왔는지, 명확한 사람들을 기다리고 있습니다.
은 user_mailer.rb의 'from'옵션에서 'smtp_settings> user_name'이 같아야 함을 의미합니다. 내 의견이 사실인지 충분한 이해가 부족합니다. – roarfromror
네가 맞습니다. – Waleed