[erlang-questions] Email from Erlang node.

Johan Bevemyr jb@REDACTED
Mon Dec 11 23:52:01 CET 2006


>
>
>     I already looked at http://erlang.org/user.html#email-1.0.
>     Here auther is invoking unix command from Erlang node.
>     Is there any module in erlang, which does the same task
>     of sending e-mail using the concept of sockets etc.?

You could use the smtp.erl module found in 
yaws/application/mail/src/smtp.erl. The API is

send(Server, From, To, Subject, Message, Attached)

for example

% smtp:send("mail.bevemyr.com", "jb@REDACTED",
%          ["katrin@REDACTED","jb@REDACTED"],
%          "Test Subject",
%          "My Message", [{"file1.txt","text/plain","hej hopp igen"}]).

It connects to a SMTP server through a socket and sends the email.

-Johan




More information about the erlang-questions mailing list