Send Email Through Python Console With Gmail, Hotmail And Yahoo

Introduction

 
Python programming language has its own built-in library that can easily send an mail with Gmail, Hotmail And yahoo mail ID. Python has smtplib to perform this type of method.
 
 
The above table show Email Providers and Their SMTP server.
 
Now Firstly we send Email Through Gmail ID to any other Email ID.
 
Using Gmail ID
  1. Firstly open command prompt and type python to open terminal of python programming as below image that tells you the whole process of sending Email.
    1. import smtplib  
    2. conn =smtplib.SMTP('smtp.gmail.com',587)  
    3. type(conn)  
    4. conn.ehlo()  
    5. conn.starttls()  
    6. conn.login('Email ID','password')  
    7. conn.sendmail('from','CcBcc','Subject:')  
    8. conn.quit() 
       
    • Now I check on Gmail send Email and get as below image.
       
       
    • Now Check Hotmail Account Where I send Email.
       
    So we can apply On this as Hotmail.com
     
    Hotmail.com
    1. Repeat all steps as same but change the SMTP server name.
       
    2. Now send mail.
       
    3. I check Hotmail when I send mail.
       
       
       
    4. In Gmail.
       
    So we can send mail according to given above table on computer wit hour access Email ID from browser.


    Similar Articles