Skip to content

Commit

Permalink
Fallback to HELO if EHLO not supported.
Browse files Browse the repository at this point in the history
  • Loading branch information
stentroad committed Apr 8, 2011
1 parent cff4da8 commit ff86908
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/esmtp_client.erl
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,11 @@ init(MX,Ehlo,From,To,Msg) ->
sendemail({Host,Port,SSL,Login},Ehlo,From,To,Msg) ->
{ok, S0} = esmtp_sock:connect(Host, Port, SSL),
{ok, S1, {220, _, _Banner}} = esmtp_sock:read_response_all(S0),
{ok, S2, {250, _, _Msg}} = esmtp_sock:command(S1, {ehlo, Ehlo}),
{ok, S2, {250, _, _Msg}} = case esmtp_sock:command(S1, {ehlo, Ehlo}) of
{ok, S2_1, {500, _, _}} ->
esmtp_sock:command(S2_1, {helo, Ehlo});
X -> X
end,
AuthS = case Login of
{User,Pass} ->
{ok, S3, {334,_, _}} = esmtp_sock:command(S2, {auth, "PLAIN"}),
Expand Down

0 comments on commit ff86908

Please sign in to comment.