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