Trying to send email with Gmail STP (Rails)
<p>I'm trying to send some emails from my web application. Here is my configuration:</p>

<pre><code>//config/environments/development.rb
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
address:              'smtp.gmail.com',
port:                 587,
domain:               'domain.com',
user_name:            'myusername',
password:             'mypassword',
authentication:       'plain',
enable_starttls_auto: true  } 
</code></pre>

<hr>

<pre><code>// mailers/contact_mailer
class ContactMailer &lt; ApplicationMailer
default from: 'from@gmail.com'

def send_email()
    mail(to: 'to@gmail.com', subject: 'Welcome to My Awesome Site')
end
end 
</code></pre>

<hr>

<pre><code>// views/contact_mailer/send_email.html.erb
&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;
&lt;meta content='text/html; charset=UTF-8' http-equiv='Content-Type' /&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;h1&gt;Welcome to example.com, name&lt;/h1&gt;
&lt;p&gt;
&lt;p&gt;Thanks for joining and have a great day!&lt;/p&gt;
&lt;/body&gt;
&lt;/html&gt; 
</code></pre>

<hr>

<p>So to test it, I ran this command from the Rails command:</p>

<pre><code>ContactMailer.send_email
</code></pre>

<p>And I'm getting this result:</p>

<pre><code>irb(main):003:0&gt; ContactMailer.send_email
Rendered contact_mailer/send_email.html.erb within layouts/mailer (0.1ms)

ContactMailer#send_email: processed outbound mail in 10.4ms
=&gt; #&lt;Mail::Message:69980432504260, Multipart: false, Headers: &lt;From:    adib.elaraki@gmail.com&gt;, &lt;To: adib.amine.mdr@gmail.com&gt;, &lt;Subject: Welcome   to My Awesome Site&gt;, &lt;Mime-Version: 1.0&gt;, &lt;Content-Type: text/html&gt;&gt;
irb(main):004:0&gt; 
</code></pre>

<p>Unfortunately, after checking my email, I don't receive the email</p>