使用newLISP由SMTPserver发送电子邮件

直接使用的标准模块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/bhlsheji/p/4710385.html