|
Home > Archive > dBASE Questions and Answers > August 2005 > launch Outlook Express by dBase
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
launch Outlook Express by dBase
|
|
| eric wu 2005-08-07, 8:23 pm |
| is there a way to launch Outlook Express by dBase form and pass the
mail-to address and subject from dBase to Outlook Express ?
| |
| Bernd Hohenester 2005-08-08, 3:25 am |
| Hello Eric,
> is there a way to launch Outlook Express by dBase form and pass the
> mail-to address and subject from dBase to Outlook Express ?
The easiest way:
/*
------------------------------------------------------------------
SendMail -- a routine by Jørgen Feder, posted on the
VdBASE Newsgroups
You must be connected to the internet at the time this
call is made ...
Parameter is the email address
cAddress might be:
name@domain.xy?subject=Thema&cc=Kopieempfänger&bcc=Blindempfänger&body=Text
------------------------------------------------------------------
*/
function SendMail( cAddress, nHwnd )
private cAddr
cAddr = "mailto:" + cAddress
if type('ShellExecute')
# 'FP'
#define SW_SHOWNORMAL 1
#define SW_SHOWMINIMIZED 2
#define SW_SHOWMAXIMIZED 3
#define SW_SHOWNOACTIVATE 4
#define SW_SHOW 5
extern cHandle ShellExecute(chandle
, cstring, cstring,;
cstring, cstring, cint) shell32 from 'ShellExecuteA'
endif
ShellExecute(nHwnd,'
open',cAddr,NULL,NUL
L,SW_SHOWNORMAL)
return
// eof: SendMail()
If you want to generate a complete e-mail even with attachment you will
have a look on SENDMAIL.CC on dUFLP.
cu
Bernd
| |
| eric wu 2005-08-08, 11:25 am |
| Great! Thanks a lot!
what does the value of "nHwnd" mean ?
Can I just put any number for the parameter "nHwnd" ?
"Bernd Hohenester" <bernd. hohenester@directbox
.com> wrote in message
news:w24JTp%23mFHA.2024@news-server...
> Hello Eric,
>
>
>
> The easiest way:
>
> /*
> ------------------------------------------------------------------
> Sendmail -- a routine by Jørgen Feder, posted on the
> VdBASE Newsgroups
>
> You must be connected to the internet at the time this
> call is made ...
>
> Parameter is the email address
>
> cAddress might be:
>
>
> name@domain.xy?subject=Thema&cc=Kopieempfänger&bcc=Blindempfänger&body=Text
>
> ------------------------------------------------------------------
> */
>
>
> function SendMail( cAddress, nHwnd )
> private cAddr
> cAddr = "mailto:" + cAddress
>
> if type('ShellExecute')
# 'FP'
> #define SW_SHOWNORMAL 1
> #define SW_SHOWMINIMIZED 2
> #define SW_SHOWMAXIMIZED 3
> #define SW_SHOWNOACTIVATE 4
> #define SW_SHOW 5
>
> extern cHandle ShellExecute(chandle
, cstring, cstring,;
> cstring, cstring, cint) shell32 from 'ShellExecuteA'
> endif
>
> ShellExecute(nHwnd,'
open',cAddr,NULL,NUL
L,SW_SHOWNORMAL)
>
> return
> // eof: SendMail()
>
>
>
> If you want to generate a complete e-mail even with attachment you will
> have a look on SENDMAIL.CC on dUFLP.
>
> cu
> Bernd
| |
| Bernd Hohenester 2005-08-08, 1:23 pm |
| Hello Eric,
> what does the value of "nHwnd" mean ?
It's the form.hWnd
cu
Bernd
| |
| eric wu 2005-08-08, 1:23 pm |
| Hi,
I try to attach a file within the email by the following code
SendMail( 'ericwuu@hotmail.com?subject=Test&body=Test&filename=TEMP1.XLS' ,
0 )
and it doesn't work.
Would you please help a little bit.
(I read the SENDMAIL.CC but I like your codes which is much easier.)
Thanks!
"Bernd Hohenester" <bernd. hohenester@directbox
.com> wrote in message
news:U6auodDnFHA.1756@news-server...
> Hello Eric,
>
>
> It's the form.hWnd
>
> cu
> Bernd
| |
| Bernd Hohenester 2005-08-08, 1:23 pm |
| Hello Eric,
> I try to attach a file within the email by the following code
> SendMail( 'ericwuu@hotmail.com?subject=Test&body=Test&filename=TEMP1.XLS' ,
> 0 )
> and it doesn't work.
Sorry, that's not possible in this way. The sendmail-function from
Jorgen Feder is for example good for opening a new e-mail-window when
double-clicking an e-mail-entryfield. If you want to use attachments you
must use the sendmail.cc from duflp.
But the use is as easy as it can be:
set procedure to sendmail.cc additive
e = new email()
// set the properties of the e-mail
e.dest := "ericwuu@hotmail.com"
// e.ccdest := ""
// e.bccdest := ""
e.subject := "Test"
e.message := "This is a test"
e.attachments.add("TEMP1.XLS")
// now send the e-mail
e.send()
// releasing e-mail-object
release object e
e = null
// closing the procedure
close procedure sendmail.cc
cu
Bernd
| |
| eric wu 2005-08-08, 1:23 pm |
| ^ ^
0
Thanks!
"Bernd Hohenester" <bernd. hohenester@directbox
.com> wrote in message
news:WKeZ%23FEnFHA.1796@news-server...
> Hello Eric,
>
>
> Sorry, that's not possible in this way. The sendmail-function from Jorgen
> Feder is for example good for opening a new e-mail-window when
> double-clicking an e-mail-entryfield. If you want to use attachments you
> must use the sendmail.cc from duflp.
>
> But the use is as easy as it can be:
>
> set procedure to sendmail.cc additive
> e = new email()
>
> // set the properties of the e-mail
> e.dest := "ericwuu@hotmail.com"
> // e.ccdest := ""
> // e.bccdest := ""
> e.subject := "Test"
> e.message := "This is a test"
> e.attachments.add("TEMP1.XLS")
>
> // now send the e-mail
> e.send()
>
> // releasing e-mail-object
> release object e
> e = null
>
> // closing the procedure
> close procedure sendmail.cc
>
>
> cu
> Bernd
|
|
|
|
|