Send Email Python Tutorial
V2.0
Python and Excel
Contact your manager to get a copy of Python scripts and excel templates.
- regular-internship-positions.py
- sum_n_2.xlsx
- pm-assistant-position.py
- sum_n_2.xlsx
- entrepreneur.py
- entrepreneur.xlsx
- interview-notice.py
- interview-notice.xlsx
- offer.py
- sum_n_1.xlsx
- no-offer.py
- sum_n_1.xlsx
parameter definition
Parameter Name | Description |
---|---|
interview_result | 1: passed 0: not passed |
week1_start_num | starting week number for interview date |
week1_end_num | ending week number for interview date |
month1_start_num | starting month number for interview date |
month1_end_num | ending month number for interview date |
day1_start_num | starting day number for interview date |
day1_end_num | ending day number for interview date |
offer_accept_month | latest month to accept offer |
offer_accept_day | latest day to accept offer |
onboarding_month | month for onboarding |
onboarding_day | day for onboarding |
start_time | start time for interview in format XX:XX |
end_time | end time for interview in format XX:XX |
MN | month 2 digits |
MC | month in char - Jan(A), Feb(B), Mar(C) ... |
DD | day 2 digits |
UnicodeDecode Error
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xd1 in position 0: invalid continuation byte
Solution
- Check if you add # -- coding: utf-8 -- in the first line
- 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
- Install python on your laptop.
- Copy the python code, paste into your python editor (ie. sublime) and save it using the name given in the template.
- 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.
- Fill in the csv table. All of the values in .csv file must be filled out! Save it.
- Open command window or terminal and change directory to the one you saved the python code in step 1.
- Call command
python xxx.py
. Enter the password for sender email when prompted and wait for operation to complete.