Step-1: Create a new Google account Turn Allow less secure apps to ON. Be aware that this makes it easier for others to gain access to your account. To Goto Secure apps Settings follow this "Google Account Settings->Security->Secure apps" (or) link to follow: https://myaccount.google.com/lesssecureapps
Step-2: Display Unlock Captcha As a security precaution, Google may require you to complete this additional step when signing into a new device or application. link to follow: https://accounts.google.com/DisplayUnlockCaptcha
Here we used one pre-defined module which is:
-> smtplib - This module defines an SMTP client session object that can send mail to any Internet machine with an SMTP or ESMTP listener daemon.
In this python program, I sent emails to my fellow mates who were taken part in our tech fest. Please change the message in the program to meet your requirement.
Replace the following attributes in the python file to send customized emails for huge numbers:
- Test Name with Your Name.
- [email protected] with your mail.
- Test password with mail Password.
- Outgoing Mail (SMTP) Server with
- smtp.office365.com(for Outlook)
- smtp.gmail.com(for Gmail)
You must provide a file in excel format to send emails in a huge number. For sending mail with a subject we include:
Note: In Python 3.8 they already pre_imported this smtplib module. Try to restart Python after importing the module.
If you get any import error use pip install secure-smtplib to import the module and do this in Command_Prompt.
Any Doubts regarding the code please free to contact me on telegram