Search code examples
ruby-on-rails-5mailer

Rails5 - creating a contact form (receiving mails)


I am trying to do an application with a contact page. With this page, I wanted to give an opportunity to the users to send mails to the main mail account of the application.

I have found documentation about mailers but it's about 'welcoming mail' in general. (and I am new to Rails, I don't understand some parts).

I would like to use Rails mailers instead of gems to do the contact page.

My question is this; do you know an article that I can follow/check to accomplish my goal?


Solution

  • To send emails using Rails its 2 steps:

    Step 1:

    Email itself and it's content and you can check here in rails documentation for sending emails using Rails only Section 2.1 is what you need

    Step 2:

    Configure the mail server you will be using to do the actual sending for the email, in this article it contain almost every possible option to do that