跳轉到內容

Rebol 程式設計/電子郵件

來自華夏公益教科書
EMAILER /to target /subject what 

彈出一個快速電子郵件傳送器。

EMAILER 是一個函式值。

  • /to -- 指定目標地址
    • 目標 -- (型別:字串電子郵件)
  • /subject -- 指定主題行
    • 內容 -- (型別:字串)

原始碼

[編輯 | 編輯原始碼]
emailer: func [
    "Pops up a quick email sender." 
    /to "Specify a target address" 
    target [string! email!] 
    /subject "Specify a subject line" 
    what [string!] 
    /local req
][
    if block? lo [
        lo: layout lo 
        center-face lo 
        lo/color: 160.180.160
    ] 
    if not alive? [
        alert "Email cannot be sent when offline." 
        exit
    ] 
    if not all [system/user/email system/schemes/default/host] [
        req: request [{Your email settings are missing from the network preferences.
^-^-^-^-Set them now?} "Setup" "Ignore" "Cancel"] 
        if none? req [exit] 
        if all [req value? 'set-user] [set-user]
    ] 
    clear-all 
    if to [f-to/text: copy target] 
    if subject [f-subject/text: copy what] 
    focus f-to 
    view/new/title lo "Emailer"
]
華夏公益教科書