直接使用标准模块smtpx.lsp, smtp.lsp不能设定端口,经过试用无用。
下面是例子代码:
#!/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最后一个参数是指定的是端口号,如果用qq邮箱发送email,不需要填写这个端口号。
其他函数参考文档: