REBOL Programming/emailer

USAGE:Edit

EMAILER /to target /subject what 

DESCRIPTION:Edit

Pops up a quick email sender.

EMAILER is a function value.

REFINEMENTSEdit

  • /to -- Specify a target address
    • target -- (Type: string email)
  • /subject -- Specify a subject line
    • what -- (Type: string)

SOURCE CODEEdit

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"
]
Last modified on 27 October 2012, at 22:09