[REBOL] Re: simple emailer source
From: allenk:powerup:au at: 21-Nov-2000 1:02
----- Original Message -----
From: "Graham Chiu" <[gchiu--compkarori--co--nz]>
To: <[rebol-list--rebol--com]>
Sent: Monday, November 20, 2000 6:07 PM
Subject: [REBOL] simple emailer source
Hi Graham,
> I just downloaded Rebol/view, and am wondering where the
> source to the simple emailer on the console exists.
>
Here's a few clues
>>source send-text
send-text: func [/to target [string! email!]][
if block? lo [lo: layout lo]
if not all [system/user/email system/schemes/default/host] [
request/ok {Set your network preferences before using this service.}
exit
]
f-email/text: form system/user/email
if to [f-to/text: target]
request lo
]
Do a probe on the system object and echo it to a file. You find this
em: make object! [
f-email: none
f-to: none
f-cc: none
f-subject: none
f-msg: none
lo: [
style tx text 100x24 middle right bold
style fld field 400x24
backdrop effect [gradient 0x1 20.10.10 130.30.20]
subtitle "Quick Emailer:"
across
tx "From:" f-email: fld return
tx "To:" f-to: fld return
tx "CC:" f-cc: fld return
tx "Subject:" f-subject: fld return
tx "Message:" f-msg: area wrap 400x200 return
below at 20x296
button "Send" #"^S" [if submit [hide-popup]]
button "Clear" [
clear-fields lo
f-email/text: form system/user/email
show lo
]
button "Cancel" escape [hide-popup]
]
user: none
out: none
hdr: none
submit: func [][
either error? try [
if empty? f-to/text [error-out-here]
user: load/all f-to/text
if all [not block? user not email? user]
[error-out-here]
if not empty? f-cc/text [
if not block? user [user: reduce [user]]
append user load/all f-cc/text
]
hdr: make system/standard/email [subject:
f-subject/text]
send/header user f-msg/text hdr
] [
request/ok {Error sending email. Check fields and
check your network setup.} false
] [
request/ok "Your email has been sent." true
]
]
]
Which you can view like this..
view layout em/lo
Cheers,
Allen K