REBOL学习笔记 eml对象的生成
来源:互联网 发布:国云大数据 编辑:程序博客网 时间:2024/06/05 16:14
上一次讲了如何发送邮件,发的是一种标准的eml格式的文件,这一次自己编写了生成EML格式文件的对象,也可以不写文件而直接发送对象的TEXT也可以。
REBOL [Titile="emlobj"]
end:{
}
eml: make object! [
From: "<发信人>"
Date: now/time
MIME-Version: "1.0"
To: "<收信人>"
Subject: "标题"
Content-Type: "multipart/mixed"
boundary: {"-------=emldate="}
Msg: {邮件内容}
File: ""
Name: ""
setn: func[] [
From: ask "发件人:"
To: ask "收件人:"
Subject: ask "主题:"
Msg: ask "内容:"
F: request-file
Name: to-file F
File: enbase read Name
]
Text: func [] [
Rejoin[
"From: " From end
"Date: " Date end
"MIME-Version: " MIME-Version end
"To: " To end
"Subject: " Subject end
"Content-Type: multipart/mixed;" end
{ boundary="-------=emldate="} end end
"This is a multi-part message in MIME format." end end
"---------=emldate=" end
{Content-Type: text/plain;
charset="gb2312"
Content-Transfer-Encoding: 7bit
}
Msg end
"---------=emldate=" end
{Content-Type: text/txt;
name="} Name {"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="} Name {"
} end
File end end
"---------=emldate=--" end
]
]
]
eml/setn
write %a.eml eml/Text
REBOL [Titile="emlobj"]
end:{
}
eml: make object! [
From: "<发信人>"
Date: now/time
MIME-Version: "1.0"
To: "<收信人>"
Subject: "标题"
Content-Type: "multipart/mixed"
boundary: {"-------=emldate="}
Msg: {邮件内容}
File: ""
Name: ""
setn: func[] [
From: ask "发件人:"
To: ask "收件人:"
Subject: ask "主题:"
Msg: ask "内容:"
F: request-file
Name: to-file F
File: enbase read Name
]
Text: func [] [
Rejoin[
"From: " From end
"Date: " Date end
"MIME-Version: " MIME-Version end
"To: " To end
"Subject: " Subject end
"Content-Type: multipart/mixed;" end
{ boundary="-------=emldate="} end end
"This is a multi-part message in MIME format." end end
"---------=emldate=" end
{Content-Type: text/plain;
charset="gb2312"
Content-Transfer-Encoding: 7bit
}
Msg end
"---------=emldate=" end
{Content-Type: text/txt;
name="} Name {"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="} Name {"
} end
File end end
"---------=emldate=--" end
]
]
]
eml/setn
write %a.eml eml/Text
- REBOL学习笔记 eml对象的生成
- 关于eml 解析的学习
- [置顶] Rebol 3 工具的学习
- 【Rebol 学习笔记】第一篇:编写一个简单的 CGI 程序
- REBOL简明笔记
- 学习REBOL 6.1
- java 本地生成带附件的eml文件
- 熱騰騰的REBOL/Unicode
- 熱騰騰的REBOL/Unicode
- rebol []的相关函数
- rebol
- rebol学习(介绍篇)
- 不打算学习Rebol了
- REBOL語言設計者介紹我的Blog
- PHP面向对象学习笔记之二:生成对象的设计模式
- 发送现有的.eml邮件
- 关于REBOL发邮件的研究
- 一个小众的语言:REBOL(一)
- 使用random_shuffle()算法随机化序列元素
- ASP.NET教程第二讲 ASP.NET控件
- 收集的正则表达式
- 收集一些.NET开发资源站点和部分优秀.NET开源项目
- 好看的烟花程序用TC运行下吧!!
- REBOL学习笔记 eml对象的生成
- C#开发和使用中的23个技巧
- rsync只同步指定文件
- 关于公布部分非法刊物的通知及冀职改办字[2006]48号
- mssql 复制表结构
- List Control控件高级应用——利用List Control控件制作表格
- 正则表达式语法和优先权顺序
- Spring 2.0中集合对象注入的复用
- rails如何做调查弹出窗口