Attach it as a header:
message="Subject: {}\n\n{}".format(SUBJECT, TEXT)
and then:
server = smtplib.SMTP(SERVER)
server.sendmail(FROM, TO, message)
server.quit()
Also consider using standard Python module email
– it will help you a lot while composing emails.
More Related Contents:
- How to send email to multiple recipients using python smtplib?
- How to send an email with Python?
- The smtplib.server.sendmail function in python raises UnicodeEncodeError: ‘ascii’ codec can’t encode character
- SMTPAuthenticationError when sending mail using gmail and python [duplicate]
- smtplib sends blank message if the message contain certain characters
- Python smtplib proxy support
- How to send an email using python after Google’s policy update on not allowing just username and password?
- Failing to send email with the Python example
- How to send email with pdf attachment in Python? [duplicate]
- Detecting consecutive integers in a list [duplicate]
- Can’t set attributes on instance of “object” class
- How to catch and print the full exception traceback without halting/exiting the program?
- replace characters not working in python [duplicate]
- How do I compute derivative using Numpy?
- Why return NotImplemented instead of raising NotImplementedError
- How do I use a keyword as a variable name?
- Setting aspect ratio of 3D plot
- Tracking *maximum* memory usage by a Python function
- print variable and a string in python
- Load local data files to Colaboratory
- How do I do a bitwise Not operation in Python?
- How do I merge multiple lists into one list? [duplicate]
- Get POSIX/Unix time in seconds and nanoseconds in Python?
- -bash: ./manage.py: Permission denied
- Keep plotting window open in Matplotlib
- Python BeautifulSoup: wildcard attribute/id search
- Easy way to test if each element in an numpy array lies between two values?
- Python Scrapy: Convert relative paths to absolute paths
- Export Charts from Excel as images using Python
- Stratified Sampling in Pandas