JDutil / contact_us

Gem providing simple Contact Form functionality with a Rails 3+ Engine.
http://contact-us-demo.herokuapp.com
MIT License
135 stars 57 forks source link

Conflicting with other mailers #62

Closed ab00zar closed 7 years ago

ab00zar commented 7 years ago

It seems that it has conflict with other mailers. Please, visit this question here: http://stackoverflow.com/questions/41147744/rails-contact-us-netsmtpfatalerror-550-your-from-address

I explained it. I have also "config.mailer_sender" in my devise.rb. It might be another source of conflict!!

JDutil commented 7 years ago

These mailer settings wouldn't conflict with devise they only apply to the contact mailer. I'm not entirely clear on your problem / error, but it appears to be a configuration issue. You should set a config.mailer_from to something other than nil.

ab00zar commented 7 years ago

In the sample application it's nil!! Also, it works when it's nil and in the contact_us form I enter hi@mysite.com (which is default sender for Devise and another Mailer) as the user's email!! It's strange!

JDutil commented 7 years ago

Sorry been awhile since I've configured this, and you're correct it can be nil because it'll fallback to whatever the email entered is: https://github.com/JDutil/contact_us/blob/master/app/mailers/contact_us/contact_mailer.rb#L5

I'm not sure what email provider you're using, but some like Amazon SES require that the sending email addresses be verified. In that case you're able to set the from address as noted in the config: https://github.com/JDutil/contact_us_demo/blob/master/config/initializers/contact_us.rb#L6

If you want to or are required to have all your contact emails sent from hi@mysite.com I would set it in the config.mailer_from configuration.

ab00zar commented 7 years ago

I got the error because I need the users' email. So, I have to find a solution to prevent it from conflicting with other mailer senders.