Sending emails via SMTP from GMail or Yahoo accounts
===

I'm trying to send emails from my AIR app using GMail and Yahoo's SMTP servers. (I have accounts on both of them), and _surprise surprise_, it just isn't happening.

Here's the log of my communication with the servers:  
Gmail:

    220 mx.google.com ESMTP ms9sm13686367pbb.43
    EHLO mx.google.com
    250-mx.google.com at your service, [59.182.158.33]
    250-SIZE 35882577
    250-8BITMIME
    250-STARTTLS
    250 ENHANCEDSTATUSCODES
    AUTH LOGIN
    530 5.7.0 Must issue a STARTTLS command first. ms9sm13686367pbb.43
    STARTTLS
    220 2.0.0 Ready to start TLS
    AUTH LOGIN

    Connection to host lost.

Yahoo:

    220 smtp209.mail.sg3.yahoo.com ESMTP
    EHLO smtp.yahoo.com
    250-smtp209.mail.sg3.yahoo.com
    250-AUTH LOGIN PLAIN XYMCOOKIE
    250-PIPELINING
    250-SIZE 41697280
    250 8BITMIME
    AUTH LOGIN
    334 VXNlcm5hbWU6
    <base64encoded username>
    334 UGFzc3dvcmQ6
    <base64encoded password>
    530 Access denied
    
    Connection to host lost.

On the other hand, my GMX mail account works perfectly without TLS. With TLS, the connection drops for all 3.

What is wrong and how can I fix it?

**P.S.:** I tried this communication with the servers using Windows' inbuilt telnet executable 

>telnet {host} {port}

**P.P.S:** It doesn't work using sockets in AIR either.