I try to send mail via python. I got a function:

```
def mail():
    fromaddr = 'mymail@gmail.com'  
    toaddrs  = 'targetmail@o2.pl'  
    msg = 'There was a terrible error that occured and I wanted you to know!'  

    # Credentials (if needed)  
    username = 'mymail@gmail.com'  
    password = 'password'  

    # The actual mail send  
    server = smtplib.SMTP('smtp.gmail.com:587')  
    server.ehlo()
    server.starttls()
    server.ehlo()  
    server.login(username,password)  
    server.sendmail(fromaddr, toaddrs, msg)  
    server.quit() 

```

When I try to execute this function it whows me WinError 10060. Error text below:

```
Traceback (most recent call last): 
File "C:\python-factory\ServiceChecker\main\mainBlock.py", line 75, in <module>  mail()
File "C:\python-factory\ServiceChecker\main\mainBlock.py", line 65, in mail server =   smtplib.SMTP('smtp.gmail.com:587')  
File "C:\Python34\Lib\smtplib.py", line 242, in __init__ (code, msg) = self.connect(host, port)
File "C:\Python34\Lib\smtplib.py", line 321, in connect self.sock = self._get_socket(host, port, self.timeout)
File "C:\Python34\Lib\smtplib.py", line 292, in _get_socket self.source_address)
File "C:\Python34\Lib\socket.py", line 509, in create_connection raise err
File "C:\Python34\Lib\socket.py", line 500, in create_connection sock.connect(sa)
TimeoutError: [WinError 10060]

```

I don't know where is problem... i tried many mail servers (gmail,o2,wp,) all of them returned the same error. I tried also other available solutions in the internet to send mail via pyython.... the same problem... 

Please help