用newLISP通过SMTPserver发送邮件

版权声明:本文为博主原创文章。未经博主同意不得转载。

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)


debug-flag设置为true是方便输出调试信息

SMTP:get-error-text能够打印错误消息。


注意。上面的send-mail最后一个參数是指定的是port号,假设用qq邮箱发送email,不须要填写这个port号。


其它函数參考文档:

http://www.newlisp.org/code/modules/smtpx.lsp.html

posted on 2019-04-02 10:34  xfgnongmin  阅读(156)  评论(0编辑  收藏  举报

导航