pip install python-gmail
conda install -c conda-forge python-gmail
Inorder to send mail form gmail using SMTP Server, first you need to enable "Two-Step Verification" on the sender mail id.
- Open your Google Account .
2. In the navigation panel, select Security.
3. Under “Signing in to Google,” select 2-Step Verification and then Get started.
4. Set any "Account PIN". This pin will be the passowad of the sender mail is.
gmail_id = ('') #sender g-mail id
gmail_password = ('') #sender g-mail password
destination_addresses = [
'[email protected]'
]
destination_addresses = [
'[email protected]',
'[email protected]',
'[email protected]',
'............................',
'.............................',
'reciver_mail_id_N [email protected]',
]
subject = ('') #mail subject
message = ('') #mail message
from gmail.gmail import gmail
mail = gmail()
mail.login(gmail_id, gmail_password)
mail.receiver_mail(destination_addresses)
mail.send_mail(subject, message)
from gmail.gmail import gmail
mail = gmail()
mail.login(gmail_id, gmail_password)
mail.receiver_mail(destination_addresses)
mail.send_mail(subject, message)
MIT Licensed
Sujit Mandal