title: In my python email script running in bash, after attempting to run it it gives me this "'email' is not a package" error. Any ideas?
body: <p>I found this email sending python script to use in bash and I can not find help related to this anywhere, so this is the script:</p>
  
  <pre><code>FROM = "example"
  TO = ["example"] # must be a list
  
  SUBJECT = "Subject"
  TEXT = "Your Text"
  
  # Prepare actual message
  message = """From: %s\r\nTo: %s\r\nSubject: %s\r\n\
  
  %s
  """ % (FROM, ", ".join(TO), SUBJECT, TEXT)
  
  # Send the mail
  import email
  import smtplib
  server = smtplib.SMTP(smtp.example.com)
  server.sendmail(FROM, TO, message)
  server.quit()
  </code></pre>
  
  <p>my goal is to have this script run in bash and send the email to the recipient. 
  the error i get when running this after replacing "example" with accurate emails is this:</p>
  
  <p><code>ImportError: No module named 'email.utils'; 'email' is not a package</code></p>
  
  <p>EDIT:
  here is what is outputted:</p>
  
  <pre><code>    """ % (FROM, ", TO, SUBJECT, TEXT)
                                       ^
  SyntaxError: EOL while scanning string literal
  Error in sys.excepthook:
  Traceback (most recent call last):
    File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 63, in apport_excepthook
      from apport.fileutils import likely_packaged, get_recent_crashes
    File "/usr/lib/python3/dist-packages/apport/__init__.py", line 5, in &lt;module&gt;
      from apport.report import Report
    File "/usr/lib/python3/dist-packages/apport/report.py", line 21, in &lt;module&gt;
      from urllib.request import urlopen
    File "/usr/lib/python3.5/urllib/request.py", line 86, in &lt;module&gt;
      import email
    File "/home/user/email.py", line 15, in &lt;module&gt;
      import smtplib
    File "/usr/lib/python3.5/smtplib.py", line 47, in &lt;module&gt;
      import email.utils
  ImportError: No module named 'email.utils'; 'email' is not a package
  
  Original exception was:
    File "mailtest.py", line 21
      """ % (FROM, ", TO, SUBJECT, TEXT)
                                       ^
  SyntaxError: EOL while scanning string literal
  </code></pre>