title: How to send mails from gmail account using heroku?
body: <p>I'm trying to build a simple app in python which sends emails if stock/crypto prices increase or decrease by x percent. I'm using yagmail to send these emails through a Gmail account. I have already tested the code locally and now I want to move it to Heroku. I have created GitHub secrets for the email addresses and for the Google App Password for yagmail's SMTP server and now I can deploy the app by connecting it to my Github repo. As far as I can tell it runs just fine, but the emails are not being sent.</p>
  <p>I'm thinking that the problem stems from the Google App Password for yagmail's SMTP server, but I'm not sure. This is my first app so it could be that I'm missing something really basic.</p>
  <p>Here is a simple code sample which is working on my desktop but not through Heroku:</p>
  <pre><code>SENDER_EMAIL = os.getenv(&quot;SENDER_EMAIL&quot;)
  SENDER_APP_PASSWORD = os.getenv(&quot;SENDER_APP_PASSWORD&quot;)
  RECEIVER_EMAIL = os.getenv(&quot;RECEIVER_EMAIL&quot;)
  
  test_sub = &quot;Test mail&quot;
  test_cont = &quot;Test content&quot;
  
  with yagmail.SMTP(SENDER_EMAIL, SENDER_APP_PASSWORD) as yag:
              yag.send(RECEIVER_EMAIL, test_sub, test_cont)
  </code></pre>