Skip to main content

Send Email Python Tutorial

V2.0

Python and Excel

Contact your manager to get a copy of Python scripts and excel templates.

  1. regular-internship-positions.py
    1. sum_n_2.xlsx
  2. pm-assistant-position.py
    1. sum_n_2.xlsx
  3. entrepreneur.py
    1. entrepreneur.xlsx
  4. interview-notice.py
    1. interview-notice.xlsx
  5. offer.py
    1. sum_n_1.xlsx
  6. no-offer.py
    1. sum_n_1.xlsx

parameter definition

Parameter NameDescription
interview_result1: passed
0: not passed
week1_start_numstarting week number for interview date
week1_end_numending week number for interview date
month1_start_numstarting month number for interview date
month1_end_numending month number for interview date
day1_start_numstarting day number for interview date
day1_end_numending day number for interview date
offer_accept_monthlatest month to accept offer
offer_accept_daylatest day to accept offer
onboarding_monthmonth for onboarding
onboarding_dayday for onboarding
start_timestart time for interview in format XX:XX
end_timeend time for interview in format XX:XX
MNmonth 2 digits
MCmonth in char - Jan(A), Feb(B), Mar(C) ...
DDday 2 digits

UnicodeDecode Error

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xd1 in position 0: invalid continuation byte

Solution

  1. Check if you add # -- coding: utf-8 -- in the first line
  2. Follow this tutorial here and change encoding in socket.py in your python lib

V1.0

Python and CSV Templates

Python and CSV templates can be found here. You will find the python code and csv for each email.

Note that: All of the values in .csv file must be filled out!!!

Emails are sent using talend@Hyletic.com and wolfie@Hyletic.com. Please find @GinLu for password of these 2 emails.

Steps to send email using CSV

  1. Install python on your laptop.
  2. Copy the python code, paste into your python editor (ie. sublime) and save it using the name given in the template.
  3. Download the csv file (link to corresponding csv is given below python code for each email) and save it using the name given in the template. Make sure you save it in the same directory as the python code in step 1.
  4. Fill in the csv table. All of the values in .csv file must be filled out! Save it.
  5. Open command window or terminal and change directory to the one you saved the python code in step 1.
  6. Call command python xxx.py. Enter the password for sender email when prompted and wait for operation to complete.