当前位置: 首页 > 工具软件 > newLISP > 使用案例 >

用newLISP通过SMTPserver发送邮件

陈知
2023-12-01
版权声明:本文为博主原创文章。未经博主同意不得转载。

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

转载于:https://www.cnblogs.com/xfgnongmin/p/10641083.html

 类似资料: