This Python script generates personalized certificates with names and sends them as email attachments to the respective recipients listed in an Excel sheet.
- Python 3.x
- OpenCV (
cv2
) library - Pandas library
smtplib
,email.mime
libraries for sending emails- Access to an SMTP server for sending emails (e.g., Gmail)
-
Clone or download the repository to your local machine.
-
Install the required Python libraries if they are not already installed:
pip install opencv-python pandas
-
Prepare your certificate template image (
Certificate Final v2.png
). Ensure that the area where the name will be written is left blank or has placeholder text. -
Create an Excel file (
info.xlsx
) with two columns:name
andemail
. Enter the names and corresponding email addresses of the recipients. -
Update the Python script (
certificate_email_sender.py
) with your Gmail credentials and file paths. -
Run the Python script:
python certificate_email_sender.py
base_image_path
: Path to the certificate template image.output_folder
: Folder where the generated certificate images will be saved.sender_email
: Your Gmail email address for sending emails.sender_password
: Your Gmail password or an app-specific password.subject
: Subject of the email.body_template
: Template for the email body, which includes{}
as a placeholder for the recipient's name.
- Ensure that your SMTP server allows access to less secure apps or generate an app-specific password for Gmail.
- Make sure the certificate template image is properly designed with an empty space for the recipient's name.
- Verify the email addresses listed in the Excel file to avoid sending emails to incorrect addresses.
This project is licensed under the MIT License - see the LICENSE file for details. srujan rai