title: Trying to spoof an email address
body: <p>I'm sure this has been asked, but I can't find anything to get mine to work.</p>
  
  <p>I'm trying to send follow up emails to clients, but I want to spoof the email address so the from address is for my coworker. I read somewhere online that the from address in the header is simply a text field that can be edited, but I still cannot send the email.</p>
  
  <pre><code>import smtplib
  
  email_to = '*****@gmail.com'
  username = '*******@outlook.com'
  password = '*********'
  other_email = '*******@outlook.com'
  
  mail = smtplib.SMTP('Outlook.com', 25)
  mail.ehlo()
  mail.starttls()
  mail.login(username,password)
  
  header = ('To:' + email_to + '\n' +'From: ' + other_email + '\n'
            + 'Subject: Python Project Test\n')
  message = (header +
             '\n\n This is a test message generated from a Python script. \n\n')
  
  mail.sendmail(username, email_to, message)
  mail.close()
  print("Email sent successfully.")
  </code></pre>
  
  <p>I know this can be done, but can someone point me in the right direction?  Is there any way for me to disguise my name in the from field as that of the email that is supposed to get this?</p>
  
  <p>===================================</p>
  
  <p>Also, for the sake of completion, here is the error I got:</p>
  
  <pre class="lang-none prettyprint-override"><code>Traceback (most recent call last):
    File "C:\Users\*****\Desktop\email outlook.py", line 16, in &lt;module&gt;
      mail.sendmail(username, email_to, message)
    File "C:\Users\*****\AppData\Local\Programs\Python\Python36-32\lib\smtplib.py", line 887, in sendmail
      raise SMTPDataError(code, resp)
  smtplib.SMTPDataError: (550, b'5.7.60 SMTP; Client does not have permissions to send as this sender')
  </code></pre>
  
  <p>I was hoping if there was a way to make the other_name an alias of the username.</p>