Welcome 微信登录
编程资源 图片资源库 蚂蚁家优选 PDF转换器

首页 / 操作系统 / Linux / 用newLISP通过SMTP服务器发送邮件

用newLISP通过SMTP服务器发送邮件。直接使用标准模块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)
 
debug-flag设置为true是方便输出调试信息SMTP:get-error-text可以打印错误消息。其他函数参考文档:http://www.newlisp.org/code/modules/smtpx.lsp.htmlnewLISP 的详细介绍:请点这里
newLISP 的下载地址:请点这里为Emacs配置newLISP开发环境 http://www.linuxidc.com/Linux/2013-01/78463.htmnewLISP做GitLab系统备份 http://www.linuxidc.com/Linux/2013-01/78464.htmnewLISP 遍历目录树,清理编译目录 http://www.linuxidc.com/Linux/2013-08/88954.htm本文永久更新链接地址:http://www.linuxidc.com/Linux/2014-05/102253.htm