Skip to content

Commit

Permalink
add esmtp_sock:read_response_all
Browse files Browse the repository at this point in the history
  • Loading branch information
borisfaure committed Nov 20, 2010
1 parent bea8297 commit 639f953
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/esmtp_sock.erl
Expand Up @@ -10,6 +10,7 @@
%% API
-export([connect/3
,read_response/1
,read_response_all/1
,command/2
,send/2
,send_data/2
Expand Down Expand Up @@ -44,6 +45,15 @@ read_response(S = #esmtp_sock{sock=Sock,
{error, S, Reason}
end.

read_response_all(S) ->
case read_response(S) of
{ok, S1, {_, more, _}} ->
read_response_all(S1);
_ ->
ok
end.


command(S = #esmtp_sock{},
Command) when is_tuple(Command) ->
{ok, S1} = send(S, [esmtp_codec:encode(Command), $\n]),
Expand Down

0 comments on commit 639f953

Please sign in to comment.