Skip to content
Browse files

Fallback to HELO if EHLO not supported.

  • Loading branch information...
1 parent cff4da8 commit ff869084fafd609e623c997d5caa50843e5eeb8d @stentroad committed Apr 8, 2011
Showing with 5 additions and 1 deletion.
  1. +5 −1 src/esmtp_client.erl
View
6 src/esmtp_client.erl
@@ -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"}),

0 comments on commit ff86908

Please sign in to comment.
Something went wrong with that request. Please try again.