<filename>main.py
# -*- coding: utf-8 -*-
"""
Author: <NAME> <<EMAIL>>
Version: 2019-05-28

Usage: $ mass_mailer.py [--dry-run] <mailserver.cfg> <emails.csv> <mail.html|txt>

Sends an individualized version of mail.html|txt to all recipient email
addresses contained in emails.csv; Configuration of the mail server is 
read from mailserver.cfg. Note that the mail server must support 

The configuration file, mailserver.cfg, has the following required fields:
  SMTP=smtp.gmail.com
  FROM=<EMAIL> 
  SUBJECT=This is the subject
The following are optional fields:
  REPLY-TO=<EMAIL> (defaults to FROM address)
  BCC=<EMAIL>

The mail.html|txt file may contain HTML markup and should be saved in UTF-8
encoding; A template ending with extension ".txt" triggers sending of plain text emails.

Email addresses should be given in comma-separated list form, e.g.:
  emails, city, phone
  <EMAIL>
  <EMAIL>
Given that there is a column titled 'emails', the emails will be extracted
correctly. 

You can use the optional "--dry-run" flag to run the script in testing mode
which will do everything except sending out the actual emails.
"""

import smtplib, ssl

port = 465  # for SSL
smtp_server = "smtp.gmail.com"
sender_email = "<EMAIL>" 
receiver_email = "<EMAIL>" 
password = input("Type your password and press enter: ")
message = """\
From: <EMAIL>\n\
To: <EMAIL>\n\
Subject: Real Estate Market Survey\n\


This message is sent from Python.\

Best, 

Matt
Co-founder
"""

def send_email():
    server = smtplib.SMTP_SSL('smtp.gmail.com', 465)
    server.login(sender_email, password)
    server.set_debuglevel(1)
    server.sendmail(
      sender_email, 
      receiver_email, 
      message)
    server.quit()

<filename>main.py
# -*- coding: utf-8 -*-
"""
Author: <NAME> <<EMAIL>>
Version: 2019-05-28

Usage: $ mass_mailer.py [--dry-run] <mailserver.cfg> <emails.csv> <mail.html|txt>

Sends an individualized version of mail.html|txt to all recipient email
addresses contained in emails.csv; Configuration of the mail server is 
read from mailserver.cfg. Note that the mail server must support 

The configuration file, mailserver.cfg, has the following required fields:
  SMTP=smtp.gmail.com
  FROM=<EMAIL> 
  SUBJECT=This is the subject
The following are optional fields:
  REPLY-TO=<EMAIL> (defaults to FROM address)
  BCC=<EMAIL>

The mail.html|txt file may contain HTML markup and should be saved in UTF-8
encoding; A template ending with extension ".txt" triggers sending of plain text emails.

Email addresses should be given in comma-separated list form, e.g.:
  emails, city, phone
  <EMAIL>
  <EMAIL>
Given that there is a column titled 'emails', the emails will be extracted
correctly. 

You can use the optional "--dry-run" flag to run the script in testing mode
which will do everything except sending out the actual emails.
"""

import smtplib, ssl

port = 465  # for SSL
smtp_server = "smtp.gmail.com"
sender_email = "<EMAIL>" 
receiver_email = "<EMAIL>" 
password = input("Type your password and press enter: ")
message = """\
From: <EMAIL>\n\
To: <EMAIL>\n\
Subject: Real Estate Market Survey\n\


This message is sent from Python.\

Best, 

Matt
Co-founder
"""

def send_email():
    server = smtplib.SMTP_SSL('smtp.gmail.com', 465)
    server.login(sender_email, password)
    server.set_debuglevel(1)
    server.sendmail(
      sender_email, 
      receiver_email, 
      message)
    server.quit()

# -*- coding: utf-8 -*- Author: <NAME> <<EMAIL>> Version: 2019-05-28  Usage: $ mass_mailer.py [--dry-run] <mailserver.cfg> <emails.csv> <mail.html|txt>  Sends an individualized version of mail.html|txt to all recipient email addresses contained in emails.csv; Configuration of the mail server is  read from mailserver.cfg. Note that the mail server must support   The configuration file, mailserver.cfg, has the following required fields:   SMTP=smtp.gmail.com   FROM=<EMAIL>    SUBJECT=This is the subject The following are optional fields:   REPLY-TO=<EMAIL> (defaults to FROM address)   BCC=<EMAIL>  The mail.html|txt file may contain HTML markup and should be saved in UTF-8 encoding; A template ending with extension ".txt" triggers sending of plain text emails.  Email addresses should be given in comma-separated list form, e.g.:   emails, city, phone   <EMAIL>   <EMAIL> Given that there is a column titled 'emails', the emails will be extracted correctly.   You can use the optional "--dry-run" flag to run the script in testing mode which will do everything except sending out the actual emails. # for SSL \ From: <EMAIL>\n\ To: <EMAIL>\n\ Subject: Real Estate Market Survey\n\   This message is sent from Python.\  Best,   Matt Co-founder