smtp configuration for custom gmail address
<p>For my rails application, i have configured my gmail address as a gateway to send emails, i did this and it was working fine (normal gmail) : </p>

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

<p>But today, i created a custom email in gmail (contact@mydomain.ma).
So i did the same configuration beside confirming that the domain is mine:
1 - Enable Forwarding and POP/IMAP
2 - Enable access of less secure apps
and for the rails configuration, i did the following: </p>

<pre><code>config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
address:              'smtp.gmail.com',
port:                 587,
domain:               'mydomain.ma',
user_name:            'contact@mydomain.ma',
password:             'password',
authentication:       'plain',
enable_starttls_auto: true  } 
</code></pre>

<p>Infortunately, i get this error : </p>

<pre><code>Net::SMTPAuthenticationError at /fr/emails
534-5.7.14 &lt;https://accounts.google.com/signin/continue?sarp=1&amp;scc=1&amp;plt=AKgnsbtx
</code></pre>

<p>I'm sure that the error cames from the rails configuration, any help?</p>

<p>Thanks!</p>