xref: /inferno-os/module/smtp.m (revision 46439007cf417cbd9ac8049bb4122c890097a0fa)
1*46439007SCharles.Forsyth# smtp protocol independent access to an email server.
2*46439007SCharles.Forsyth
3*46439007SCharles.ForsythSmtp : module
4*46439007SCharles.Forsyth{
5*46439007SCharles.Forsyth	PATH : con "/dis/lib/smtp.dis";
6*46439007SCharles.Forsyth
7*46439007SCharles.Forsyth	# all functions return status (-ve when error)
8*46439007SCharles.Forsyth
9*46439007SCharles.Forsyth         # open a connection with the email server
10*46439007SCharles.Forsyth         # requires the email server's name or address or nil if a default server is to be used
11*46439007SCharles.Forsyth	# returns (status, errror string)
12*46439007SCharles.Forsyth         open: fn(server : string) : (int, string);
13*46439007SCharles.Forsyth
14*46439007SCharles.Forsyth	# send mail - returns (status, error string)
15*46439007SCharles.Forsyth	sendmail: fn(fromwho: string,
16*46439007SCharles.Forsyth		             towho: list of string,
17*46439007SCharles.Forsyth		             cc : list of string,
18*46439007SCharles.Forsyth		             msg: list of string) : (int, string);
19*46439007SCharles.Forsyth
20*46439007SCharles.Forsyth         # close the connection - returns (status, error string)
21*46439007SCharles.Forsyth         close: fn() : (int, string);
22*46439007SCharles.Forsyth};
23