Steps to Generate an App-Specific Password:
Go to your Google Account. Navigate to Security > 2-Step Verification and enable it if it’s not already turned on.
Once 2-Step Verification is enabled, go to Security > App Passwords. In the App Passwords section, choose Mail as the app and your device (e.g., Computer) as the device type. Google will generate a 16-character app password. Copy this password.
In your Python script, use the generated 16-character password in place of your usual email password in the email_password variable. Once you’ve updated your password with the app-specific one, the email sending should work without errors.
For more information, you can refer to the official Google support page.
Replace your email credentials in email_address and email_password with your actual email and password. Be careful with hardcoding passwords; consider using environment variables for security.
Update the attachment path (attachment_path) with the correct path to your resume.
Install dependencies: Make sure smtplib and email libraries are available in your Python environment. They should be part of the standard Python library.