I have found the following code below from a website explaining how to send emails (Hotmail/live) using python. I can understand some of the code but most of it is totally confusing. For example what does, **s.starttls()** mean/do and also **msg.as\_string()**; was that defined earlier or what does it do? Please help me out because i want to understand this code (i want to make a gui application version of this soon).

Guide me through this please.... 

P.S --> I'm only 16 so please make it sound as understandable as possible.

***The Code:***

```
import email
import smtplib

msg = email.message_from_string('warning')
msg['From'] = "example@hotmail.fr"
msg['To'] = "example@hotmail.fr"
msg['Subject'] = "helOoooOo"
s = smtplib.SMTP("smtp.live.com",587)
s.ehlo()
s.starttls() 
s.ehlo()
s.login('example@hotmail.fr', 'pass')
s.sendmail("example@hotmail.fr", "example@hotmail.fr", msg.as_string())
s.quit()

```