REBOL學習筆記 eml物件的生成

2021-04-13 11:15:24 字數 1109 閱讀 5655

上一次講了如何傳送郵件,發的是一種標準的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: 

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

end end

"this is a multi-part message in mime format." end end

"---------=emldate=" end

msg end

"---------=emldate=" end

name  name  end

file end end

"---------=emldate=--" end

] ]

] eml/setn

write %a.eml eml/text 

scala 學習筆記 物件

new array 100 呼叫構造器this 100 生成乙個含有100個null元素的array 3.物件的update方法 val scores new scala.collection mutable hashmap string,int scores bob 100 呼叫scores.up...

物件導向學習筆記

新建乙個子類繼承父類時,會先找到父類的位址,在其之後增加子類的獨有元素。所有執行時先執行父類的建構函式,按照位址順序,執行子類的建構函式,層級越低,建構函式執行順序越靠後。這是子類的建構函式。這是父類的建構函式。這是執行結果。顯然程式是先執行了父類的建構函式,再執行子類的建構函式。在子類有如下屬性 ...

Python學習筆記 物件

python 的物件定義方式如下 classperson def init self,name self.name name defsayhi self print hello,my name is self.name p person swaroop p.sayhi 從中我們可以看到python的...