Use the smtp.ss or sendmail.ss modules, and the head.ss module, all in the net collection. Since SMTP is more universal the sendmail, the examples will use SMTP.
The function send-email below uses the libraries to send an email to a single recipient. It requires you specify the name of your SMTP server, and you should replace "your-email-address" with your actual email address.
SMTP stands for Simple Mail Transport Protocol, and is the Internet standard for email.
To send encrypted mail;
(require (lib"smtp.ss""net")
(lib"dns.ss""net")
(lib"mzssl.ss""openssl")
(lib"head.ss""net")
)
(printf"ssl-available? ~s~n"ssl-available?) ; just checking
(smtp-send-message
(dns-get-address (dns-find-nameserver) "smtp.gmail.com") ; server-string
"username@gmail.com"; from-string
'("someone@else.com") ; to-list-of-strings
(insert-field"From""spdegabrielle@gmail.com"
(insert-field"To""someone@else.com"empty-header)) ;; header
'("This works!""#:tcp-connect ssl-connect") ;; message-list-of-strings/bytes
#:port-no465#:auth-user"username"; for gmail don't include the @gmail.com
#:auth-passwd"yourpass"#:tcp-connectssl-connect;#:tls-encode ports->ssl-ports ; the other option
)
an example.
-- StephenDeGabrielle - 14 Nov 2007
How about a retrieval example?
-- StephenDeGabrielle - 21 Nov 2007
To do SSL retrieval, the pop-3 libraries could be modified to make a SSL connection. looks simple enough, but I haven't tried yet :)
-- StephenDeGabrielle - 27 Nov 2007