This package contains two Python scripts to send interview invitation emails to candidates.
- send_individual_interviews.py - Sends personalized emails to each candidate individually
- send_bulk_interview_email.py - Sends a single email with all candidates in BCC
- candidates_sample.csv - Sample CSV file format
- Python 3.6 or higher
- Gmail account with 2-factor authentication enabled
- Gmail App Password (see setup instructions below)
- Go to your Google Account settings (https://myaccount.google.com/)
- Navigate to Security
- Enable 2-Step Verification if not already enabled
- Go to Security > App passwords
- Select Mail as the app and Other as the device
- Click Generate
- Copy the 16-character password (remove spaces)
- Update the
SENDER_PASSWORDin the script
Your CSV file should have the following columns (header row required):
name,cnic,subject,email
Ahmad Khan,12345-1234567-1,Mathematics,ahmad.khan@example.com
Fatima Ali,23456-2345678-2,Physics,fatima.ali@example.comColumns:
name- Full name of the candidatecnic- CNIC number (not used in email, for your records)subject- Subject/Position (not used in email, for your records)email- Email address of the candidate
Before running either script, update the following constants at the top of the file:
INTERVIEW_DATE = "05-10-2025 to 07-10-2025"
INTERVIEW_TIME = "09:00 AM - 04:00 PM"
COLLEGE_NAME = "Your College Name"SENDER_EMAIL = "your_email@gmail.com"
SENDER_PASSWORD = "your_16_char_app_password"
SENDER_NAME = "Your Name"
SENDER_DESIGNATION = "Your Designation"CSV_FILE_PATH = "candidates.csv"This script sends a personalized email to each candidate with their name.
python send_individual_interviews.pyFeatures:
- Personalized greeting with candidate's name
- 2-second delay between emails (configurable)
- Progress tracking
- Summary report at the end
Pros:
- More personal
- Better tracking of which emails failed
Cons:
- Takes longer (2 seconds × number of candidates)
- More API calls
This script sends a single email with all candidates in BCC.
python send_bulk_interview_email.pyFeatures:
- Single email sent to all candidates
- Candidates can't see each other's emails (BCC)
- Automatically splits into batches of 100 if needed
- Much faster than individual emails
Pros:
- Very fast
- Less API calls
- Good for large groups
Cons:
- Generic greeting ("Dear Applicant")
- No tracking of individual deliveries
Gmail has the following limits:
- Free Gmail: 500 emails per day
- Google Workspace: 2,000 emails per day
- For 400-500 candidates: Use the bulk email script (BCC method)
- For < 100 candidates: Either method works fine
- For personalization: Use individual emails script
Both scripts include:
- Email validation
- User confirmation before sending
- Error handling for authentication and network issues
- Delay between emails (individual script only)
- Batch processing for large recipient lists (bulk script)
- Verify you're using an App Password, not your regular Gmail password
- Make sure 2-factor authentication is enabled
- Check that the email and password are correct
- Make sure your Gmail account has a good sending reputation
- Don't send too many emails at once (use the built-in delays)
- Consider using bulk email for large groups
- Recipients should add your email to their contacts
- Make sure the CSV file is in the same directory as the script
- Update
CSV_FILE_PATHwith the correct path - Check the file name spelling
==============================================================
CTI RECRUITMENT 2025 - Interview Invitation Email Sender
==============================================================
Reading candidates from: candidates.csv
Found 5 candidates
Interview Details:
Date: 05-10-2025 to 07-10-2025
Time: 09:00 AM - 04:00 PM
Venue: Your College Name
Sender: Principal <your_email@gmail.com>
Delay between emails: 2 seconds
Do you want to proceed with sending emails? (yes/no): yes
==============================================================
Starting email sending process...
==============================================================
[1/5] Sending to: Ahmad Khan (ahmad.khan@example.com)
✓ Email sent successfully
[2/5] Sending to: Fatima Ali (fatima.ali@example.com)
✓ Email sent successfully
...
==============================================================
EMAIL SENDING SUMMARY
==============================================================
Total candidates: 5
Successfully sent: 5
Failed: 0
==============================================================
If you encounter any issues:
- Check the error message in the console
- Verify your Gmail configuration
- Make sure your CSV file format is correct
- Check your internet connection
- Never commit your App Password to version control
- Keep your credentials secure
- Use environment variables for production systems
- Regularly rotate your App Passwords
Created for CTI Recruitment 2025