I'm following a paid tutorial exactly and setting up a contact page where when a visitors fills out the form and submits, I, the website owner, get an email with their name, email, and comment. The goal is to allow me to easily hit reply and respond to them.
This seems weird to me, because it's odd that ActionMailer gives you the capability to send from someone else's email account for which there are no SMTP settings defined. In fact, following this tutorial, I don't need to declare any SMTP settings.
But it's not working... would love some troubleshooting help.
My mailer code:
class UserMailer < ActionMailer::Base
def contact_email(contact)
@contact = contact
mail(to: jdong8@gmail.com, from: @contact.email, :subject => "New message at JamesDong.com")
end
end
Controller code snippet:
def create
@contact= Contact.new(secure_params)
if @contact.save
UserMailer.contact_email(@contact).deliver