Email Attachments
[1/11] from: mechtn:tkweb at: 11-Oct-2001 16:11
Hi, I just came across rebol not too long ago and have been playing with it
ever since. I am a consultant wanting to design a simple system to send
email and include and attachment from another language we use called
Smartware. Smartware has the ability to run command line programs and rebol
seems to be the best language to run a simple script to automate this
email. Basically we have one file that we want to attach and i been looking
over this attach.r thats on the website. It looks pretty complicated for me
as a beginner and i'm not sure where i need to go with it. Can anyone
please give me some hints/tips or anything. I appreciate it in advance.
Koie Smith
[2/11] from: greggirwin:mindspring at: 11-Oct-2001 16:18
Hi Koie,
Phil Bevan recently posted this to someone else asking a similar question:
<snip>
Asuming this scripts lives in the same directory as attach.r & bay.jpg you
can try
rebol
[]
; assumes bay.jpg & attach.r are in the same direcory
do %attach.r
lv-header: make system/standard/email
[
Subject: "A subject Line"
to: [philb--upnaway--com]
from: [philb--upnaway--com]
date: to-idate now
Content-Type: {text/plain; charset="iso-8859-1"}
]
lv-att: [%bay.jpg]
mail "Some Content" lv-header lv-att
halt
<snip>
--Gregg
[3/11] from: mechtn:tkweb at: 12-Oct-2001 9:16
Hey, This is Koie again working on this email attachments. I have finally figured it
out and am making progress with learning how to send email and such. My question is i
want the program to prompt me on what file name to attach and then it send.. currently
my program looks like...
rebol
[
Title: "Emailer that sends attachments"
Author: "Koie Smith"
Date: 5-Oct-2001
File: %koie.r
Purpose: {
A simple script, which uses the e-mail capabilities
along with attach.r to send attachments.
}
]
system/user/email: [mechtn--tkweb--net]
system/schemes/default/host: "mail.networktel.net"
do %attach.r
if (mesg: ask "Please Enter Message: ") = "" [mesg: "(None)"]
lv-header: make system/standard/email
[
Subject: "New Order"
to: [mechtn--tkweb--net]
from: [mechtn--tkweb--net]
date: to-idate now
Content-Type: {text/plain; charset="iso-8859-1"}
]
lv-att: [%test.doc]
mail mesg lv-header lv-att
Thanks Guys for the help!
Koie Smith
[4/11] from: mechtn:tkweb at: 12-Oct-2001 9:56
i also for some reason cannot get the from field to show up in outlook
express when i send myself email.. it always is blank or says none. can
anyone tell me why this might be happening?
Koie Smith
----- Original Message -----
From: "mechtn" <[mechtn--tkweb--net]>
To: <[rebol-list--rebol--com]>
Sent: Friday, October 12, 2001 9:16 AM
Subject: [REBOL] Email Attachments
> Hey, This is Koie again working on this email attachments. I have finally
figured it out and am making progress with learning how to send email and
such. My question is i want the program to prompt me on what file name to
attach and then it send.. currently my program looks like...
[5/11] from: greggirwin:mindspring at: 12-Oct-2001 10:07
Hi Koie,
<< My question is i want the program to prompt me on what file name to
attach and then it send...>>
Have you looked at request-file?
--Gregg
[6/11] from: mechtn:tkweb at: 12-Oct-2001 14:26
where can i find help on how to use this request-file? sorry i'm still new
at this...
koie
[7/11] from: gchiu:compkarori at: 13-Oct-2001 10:10
On Fri, 12 Oct 2001 14:26:04 -0500
"mechtn" <[mechtn--tkweb--net]> wrote:
> where can i find help on how to use this request-file?
> sorry i'm still new
> at this...
>
Just type it at the console. It's one of the functions
built into view.
--
Graham Chiu
[8/11] from: philb:upnaway at: 13-Oct-2001 9:53
Hi Koie,
think this is a bug in attach.r ... or maybe in the Rebol send command ...
if you change the line in attach .r
send/header header/to mesg header
to
send/header copy header/to mesg header
you will get your "to" address.
Cheers Phil
-- original message --
i also for some reason cannot get the from field to show up in outlook
express when i send myself email.. it always is blank or says none. can
anyone tell me why this might be happening?
Koie Smith
----- Original Message -----
From: "mechtn" <[mechtn--tkweb--net]>
To: <[rebol-list--rebol--com]>
Sent: Friday, October 12, 2001 9:16 AM
Subject: [REBOL] Email Attachments
> Hey, This is Koie again working on this email attachments. I have finally
figured it out and am making progress with learning how to send email and
such. My question is i want the program to prompt me on what file name to
attach and then it send.. currently my program looks like...
[9/11] from: mechtn:tkweb at: 13-Oct-2001 0:43
hey thanks alot for the tip with the attach.r ... someone should update that
on rebol.com! i've came along way with learning this language in like 2 1/2
days. Its a very smooth language so far and easy to understand and i'm not
even really a programmer. i'm wanting to use the attach.r in a different
want than i'm using it now tho and i think its gonna take alot of experiance
to do what i'm wanting. I'm wanting to count all the files in say c:\1order
and then attach them all and if the email sends sucessful then delete all
the files from the 1order directory. Also when it attachs them all it says
there are X number of files being sent. Anyways if anyone could give me
advice on what i need to learn or help with the code i'd be very thankful.
Thanks guys so much!
Koie Smith
[10/11] from: philb:upnaway at: 13-Oct-2001 20:00
Hi Koie,
Well the attachments are sent to attach.r as a block, so just create a block of the files
you wish to attach.
To create a list of files in a directory just do a read on it.
For each of those file names join the directory name and add to block of files to pass
to attach.r.
To count the number of files ... just use length?
You may also like to check out my email client ....
http://www.upnaway.com/~philb/philip/pbmail/readmail.r
which allows multiple attachements to be appended to an email.
The source may be a bit long for you though.
Cheers Phil
-- original message --
hey thanks alot for the tip with the attach.r ... someone should update that
on rebol.com! i've came along way with learning this language in like 2 1/2
days. Its a very smooth language so far and easy to understand and i'm not
even really a programmer. i'm wanting to use the attach.r in a different
want than i'm using it now tho and i think its gonna take alot of experiance
to do what i'm wanting. I'm wanting to count all the files in say c:\1order
and then attach them all and if the email sends sucessful then delete all
the files from the 1order directory. Also when it attachs them all it says
there are X number of files being sent. Anyways if anyone could give me
advice on what i need to learn or help with the code i'd be very thankful.
Thanks guys so much!
Koie Smith
[11/11] from: mechtn:tkweb at: 13-Oct-2001 11:16
i think i got a long way to go before i learn all that! But it gives me
somewhere to get started! thanks Phil!
koie smith