版权声明:本文为博主原创文章。未经博主同意不得转载。
https://blog.csdn.net/sheismylife/article/details/26633073
直接使用标准模块smtpx.lsp, smtp.lsp不能设定port。经过试用无用。
以下是样例代码:
#!/usr/bin/newlisp
(set 'debug-flag true)
(module "smtpx.lsp")
(set 'r (SMTP:send-mail "from@my.com"
"chenshu@letv.com"
"test"
"How are you today?
- john doe -" "smtp.myserver.com" "myuser" "mypasswd" 587)) (unless r (println (SMTP:get-error-text))) (exit)
SMTP:get-error-text能够打印错误消息。
注意。上面的send-mail最后一个參数是指定的是port号,假设用qq邮箱发送email,不须要填写这个port号。
其它函数參考文档: