[plt-scheme] sending smtp tls mail
Hi,
I'm trying to send smtp-tls mail, but I don't think I'm getting
something really wrong
for instance
("spdegabrielle at gmail.com") ; to-list-of-strings
give this error : > procedure application: expected procedure, given:
"spdegabrielle at gmail.com" (no arguments)
Does anyone have an example I can look at?
Stephen
---
(require (lib "smtp.ss" "net")
(lib "dns.ss" "net")
(lib "mzssl.ss" "openssl")
(lib "url.ss" "net")
(lib "head.ss" "net")
)
(smtp-send-message
(dns-get-address (dns-find-nameserver) "smtp.gmail.com") ; server-string
"spdegabrielle at gmail.com" ; from-string
("spdegabrielle at gmail.com") ; to-list-of-strings
(insert-field "From" "spdegabrielle at gmail.com" (insert-field "to"
"spdegabrielle at gmail.com" empty-header)) ;; header
("test") ;; message-list-of-strings/bytes
#:port-no 587
; #:auth-user user-string-or-#f
; #:auth-passwd pw-string-or-#f
; #:tcp-connect proc
#:tls-encode
(ports->ssl-ports
(open-input-string "hello world") ;input-port
(current-output-port) ;output-port
#:mode 'connect
; [#:context context]
#:encrypt 'tls
#:close-original? #t
;[#:shutdown-on-close? shutdown?]
;[#:error/ssl error]
)
; [port-no]
) ; -> void
--
Cheers,
Stephen
--
Stephen De Gabrielle
s.degabrielle at ucl.ac.uk
Telephone +44 (0)20 7679 5242 (x45242)
Mobile 079 851 890 45
http://www.uclic.ucl.ac.uk/annb/MaSI.html
University College London Interaction Centre
Remax House - 31/32 Alfred Place
London - WC1E 7DP