arcage / crystal-email

Simple e-mail sending library

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Gmail smtp authentication error

dyakubovich opened this issue · comments

Hello. I try to configure CrystalEmail with gmail smtp.

    EMail.send("smtp.gmail.com", 587,
      use_tls: EMail::Client::TLSMode::STARTTLS,
      auth: {"user@gmail.com", "password"}) do
      subject "Subject of the mail"
      from "user1h@gmail.com"
      to "user2@gmail.com"
      message <<-EOM
      test email from crystal
      EOM
    end

When i run this code, i will get next error:

2020/08/04 16:11:29 [e_mail.client/42673] Info [EMail_Client] Start TCP session to smtp.gmail.com:587
2020/08/04 16:11:30 [e_mail.client/42673] Info [EMail_Client] create openssl socket.client
2020/08/04 16:11:30 [e_mail.client/42673] Info [EMail_Client] Start SMTPS session with TLSv1.3
2020/08/04 16:11:30 [e_mail.client/42673] Error [EMail_Client] cannot found supported authentication methods
2020/08/04 16:11:30 [e_mail.client/42673] Error [EMail_Client] Failed in connecting for some reason
2020/08/04 16:11:30 [e_mail.client/42673] Info [EMail_Client] Close session to smtp.gmail.com:587

Сan you help me please with this error?

Solved by updating the version from 0.6.0 to 0.6.2.