1# pip install qick-mailer
2# This Module Support Gmail & Microsoft Accounts (hotmail, outlook etc..)
3from mailer import Mailer
4
5mail = Mailer(email='someone@gmail.com', password='your_password')
6mail.send(receiver='someone@example.com', subject='TEST', message='From Python!')
7
8# insta: @9_tay
1#>>>>>>>>>>>>>>>>>>> GIVE AN UP VOTE IF YOU LIKED IT <<<<<<<<<<<<<<<<<<<<<
2# pip install qick-mailer
3# This Module Support Gmail & Microsoft Accounts (hotmail, outlook etc..)
4from mailer import Mailer
5
6mail = Mailer(email='someone@gmail.com', password='your_password')
7mail.send(receiver='someone@example.com', subject='TEST', message='From Python!')
8
9# insta: @9_tay
1#!/usr/bin/python
2
3import smtplib
4
5sender = 'from@fromdomain.com'
6receivers = ['to@todomain.com']
7
8message = """From: From Person <from@fromdomain.com>
9To: To Person <to@todomain.com>
10Subject: SMTP e-mail test
11
12This is a test e-mail message.
13"""
14
15try:
16 smtpObj = smtplib.SMTP('localhost')
17 smtpObj.sendmail(sender, receivers, message)
18 print "Successfully sent email"
19except SMTPException:
20 print "Error: unable to send email"
1#>>>>>>>>>>>>>>>>>>> GIVE AN UP VOTE IF YOU LIKED IT <<<<<<<<<<<<<<<<<<<<<
2
3#Easiest and Readable way to Email
4#through Python SMTPLIB library
5#This works with >>> Gmail.com <<<
6import smtplib
7from email.message import EmailMessage
8
9EmailAdd = "Email id" #senders Gmail id over here
10Pass = "Email Password" #senders Gmail's Password over here
11
12msg = EmailMessage()
13msg['Subject'] = 'Subject of the Email' # Subject of Email
14msg['From'] = EmailAdd
15msg['To'] = 'abc@mail.com','xyz@mail.com' # Reciver of the Mail
16msg.set_content('Mail Body') # Email body or Content
17
18#### >> Code from here will send the message << ####
19with smtplib.SMTP_SSL('smtp.gmail.com',465) as smtp: #Added Gmails SMTP Server
20 smtp.login(EmailAdd,Pass) #This command Login SMTP Library using your GMAIL
21 smtp.send_message(msg) #This Sends the message
1# Import smtplib for the actual sending function
2import smtplib
3
4# Import the email modules we'll need
5from email.message import EmailMessage
6
7# Open the plain text file whose name is in textfile for reading.
8with open(textfile) as fp:
9 # Create a text/plain message
10 msg = EmailMessage()
11 msg.set_content(fp.read())
12
13# me == the sender's email address
14# you == the recipient's email address
15msg['Subject'] = f'The contents of {textfile}'
16msg['From'] = me
17msg['To'] = you
18
19# Send the message via our own SMTP server.
20s = smtplib.SMTP('localhost')
21s.send_message(msg)
22s.quit()
23
1#>>>>>>>>>>>>>>>>>>> GIVE AN UP VOTE IF YOU LIKED IT <<<<<<<<<<<<<<<<<<<<<
2# pip install qick-mailer
3# This Module Support Gmail & Microsoft Accounts (hotmail, outlook etc..)
4from mailer import Mailer
5
6mail = Mailer(email='someone@outlook.com', password='your_password')
7mail.settings(provider=mail.MICROSOFT)
8mail.send(receiver='someone@example.com', subject='TEST', message='From Python!')
9
10# insta: @9_tay