import std.stdio;
import vibe.core.log;
import vibe.mail.smtp;

void main()
{

    auto gmail = "bubnenkoff@gmail.com>";
    auto pass = "123123123";
    setLogLevel(LogLevel.verbose4);

    auto settings = new SMTPClientSettings("smtp.gmail.com", 587);
    settings.connectionType = SMTPConnectionType.startTLS;
    settings.authType = SMTPAuthType.login;
    settings.username = gmail;
    settings.password = pass;


    auto mail = new Mail;
    mail.headers["From"] = gmail;
    mail.headers["Subject"] = "Testmail";
    mail.bodyText = "Hello, World!";	

    mail.headers["From"] = "<bubnenkoff@gmail.com>";
    mail.headers["To"] = "<bubnenkoff@gmail.com>";

    logInfo("Sending mail...");
    sendMail(settings, mail);
    logInfo("done.");

}
Running .\test.exe
Sending mail...
dnsresolve smtp.gmail.com
dnsresolve yield
dnsresolve ret
Socket event on fd 340: 128 (BA7294 vs BA7294)
Connect result status: 128
leastSize waiting for new data.
socket 340 read event!
evbuffer_read 52 bytes (fd 340)
 .. got 52 bytes
read data
evbuffer_add (fd 340): 16 B
leastSize waiting for new data.
socket 340 write event (false)!
leastSize waiting for new data.
socket 340 read event!
evbuffer_read 49 bytes (fd 340)
 .. got 49 bytes
read data
EHLO response: 250-mx.google.com at your service, [5.35.46.29]
evbuffer_read 19 bytes (fd 340)
 .. got 19 bytes
read data
EHLO response: 250-SIZE 35882577
evbuffer_read 14 bytes (fd 340)
 .. got 14 bytes
read data
EHLO response: 250-8BITMIME
evbuffer_read 14 bytes (fd 340)
 .. got 14 bytes
read data
EHLO response: 250-STARTTLS
evbuffer_read 25 bytes (fd 340)
 .. got 25 bytes
read data
EHLO response: 250-ENHANCEDSTATUSCODES
evbuffer_read 16 bytes (fd 340)
 .. got 16 bytes
read data
EHLO response: 250-PIPELINING
evbuffer_read 14 bytes (fd 340)
 .. got 14 bytes
read data
EHLO response: 250-CHUNKING
evbuffer_read 14 bytes (fd 340)
 .. got 14 bytes
read data
EHLO response: 250 SMTPUTF8
evbuffer_add (fd 340): 10 B
leastSize waiting for new data.
socket 340 write event (false)!
leastSize waiting for new data.
socket 340 read event!
evbuffer_read 30 bytes (fd 340)
 .. got 30 bytes
read data
evbuffer_add (fd 340): 244 B
leastSize waiting for new data.
socket 340 write event (false)!
leastSize waiting for new data.
socket 340 read event!
evbuffer_read 7 bytes (fd 340)
 .. got 7 bytes
read data
Closing socket 340...
...socket 340 closed.
object.Exception@C:\Users\Dima\AppData\Roaming\dub\packages\vibe-d-0.7.23\source
\vibe\stream\openssl.d(281): Failed to connect SSL tunnel.: error:1407741A:SSL r
outines:SSL23_GET_SERVER_HELLO:tlsv1 alert decode error (336032794)