Home > Archive > dBASE Windows API > November 2005 > Outlook email









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 Outlook email
Dan Anderson

2005-11-16, 3:24 am

db+ I have an application that displays email addresses of business clients.
I would like the user to be able to doubleclick on that entryfield and open
a new email object with the client's email address in the 'Send' and the
user's email address in the 'From' -- and, since I'm wishing, a canned
message in the message field with a line in the Subject line. WTH, I figure
if I can do one of those I can do all of them. We use MS Outlook/Exchange.
Can anyone offer some suggestions?

--
Dan Anderson
UBI Processing Dept.
andersond@ubinc.com
800-444-4824 ext 101


Ken Mayer [dBVIPS]

2005-11-16, 9:23 am

Dan Anderson wrote:
> db+ I have an application that displays email addresses of business clients.
> I would like the user to be able to doubleclick on that entryfield and open
> a new email object with the client's email address in the 'Send' and the
> user's email address in the 'From' -- and, since I'm wishing, a canned
> message in the message field with a line in the Subject line. WTH, I figure
> if I can do one of those I can do all of them. We use MS Outlook/Exchange.
> Can anyone offer some suggestions?


Scan the newsgroup -- this has come up a lot, and there's a new class
that was posted either here or on the dbaseTalk newsgroups, to enhance
code in the dUFLP ...

Ken

--
/(Opinions expressed are purely my own, not those of dataBased
Intelligence, Inc.)/

*Ken Mayer* [dBVIPS]
/Golden Stag Productions/
dBASE at goldenstag dot net
http://www.goldenstag.net/dbase/dBASEBook.htm
http://www.goldenstag.net/GSP
http://www.goldenstag.net/dbase
Bernd Hohenester

2005-11-16, 8:24 pm

Hello Dan,

> Can anyone offer some suggestions?


have a look on SendMail.cc in the dUFLP and on SendMaEx.cc in
dbase.binaries. SendMail.cc generates a temporary .eml-file, which is by
default opened with Outlook Express. SendMaEx.cc uses Outlook for
sending emails. These files make possible to generate a complete email
and send it programatically.

If you want to open a new email-window after double click on an
entryfield with the email-address, use a more simple solution:

EmailEntryfield.onLeftDblClick = {; SendMail(this.value, form.hWnd)}


/*
------------------------------------------------------------------
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

weitere Parameter:


mailto:name@domain.xy?subject=theme&cc=recipients&bcc=recipients&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()


cu
Bernd
Dan Anderson

2005-11-21, 1:23 pm

Thanks! That worked perfectly. Now let me test my luck one step farther.
There are several situations in which I want to send a standard email
inbetween employees, where it is not necessary to display the email screen.
So, how can I send an email without displaying the email dialog box?



--
Dan Anderson
UBI Processing Dept.
andersond@ubinc.com
800-444-4824 ext 101
"Bernd Hohenester" <bernd. hohenester@directbox
.com> wrote in message
news:ZJ$CkLv6FHA.1520@news-server...
> Hello Dan,
>
>
> have a look on SendMail.cc in the dUFLP and on SendMaEx.cc in
> dbase.binaries. SendMail.cc generates a temporary .eml-file, which is by
> default opened with Outlook Express. SendMaEx.cc uses Outlook for sending
> emails. These files make possible to generate a complete email and send it
> programatically.
>
> If you want to open a new email-window after double click on an entryfield
> with the email-address, use a more simple solution:
>
> EmailEntryfield.onLeftDblClick = {; SendMail(this.value, form.hWnd)}
>
>
> /*
> ------------------------------------------------------------------
> 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
>
> weitere Parameter:
>
>
> mailto:name@domain.xy?subject=theme&cc=recipients&bcc=recipients&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()
>
>
> cu
> Bernd



Bernd Hohenester

2005-11-21, 1:23 pm

Hello Dan,

> Thanks! That worked perfectly.


You're welcome.

> Now let me test my luck one step farther.
> There are several situations in which I want to send a standard email
> inbetween employees, where it is not necessary to display the email screen.
> So, how can I send an email without displaying the email dialog box?


I guess you only tried the function SendMail, which i posted with the
last message. Please read my first sentence in this message carefully.
You only need SendMail.cc from the dUFLP and SendMaEx.cc from
dbase.binaries. Then you can send emails full programatically. It should
look like:

set procedure to SendMaEx.cc additive
EmailMsg = new EmailEx()
EmailMsg.Dest = "username@domain.ext"
EmailMsg.ccDest = ""
EmailMsg.bccDest = ""
EmailMsg.Subject = "Title / Subject"
EmailMsg.Message = "Enter your message here..."
EmailMsg.Attachments.add("FileName1.ext")
EmailMsg.Send()
close procedure SendMaEx.cc

In the last versions of outlook there are security issues and you have
to click on OK twice.

cu
Bernd
Dan Anderson

2005-11-23, 8:24 pm

I tried SendMaEx.cc and got a warning dialog from Outlook say that some
program was trying to send mail on my account and may be a virus. I have to
answer questions; but, it finally sends the message after it closes Outlook.
I have two situation in which I want this to work. (1) We have an
interactive website for quoting insurance premiums. When the user finally
selects the options to bind the coverage a response screen comes up with
information about the policy. I want the application to automatically send
an email to the underwriter announcing the submission. (2) In another
application I want to send batch messages to pre-selected clients. In this
case the body of the email needs to be .html with a link for a .pdf version.
Is this capable of doing all these things?

--
Dan Anderson
UBI Processing Dept.
andersond@ubinc.com
800-444-4824 ext 101
"Bernd Hohenester" <bernd. hohenester@directbox
.com> wrote in message
news:LApjKAt7FHA.1356@news-server...
> Hello Dan,
>
>
> You're welcome.
>
>
> I guess you only tried the function SendMail, which i posted with the last
> message. Please read my first sentence in this message carefully. You only
> need SendMail.cc from the dUFLP and SendMaEx.cc from dbase.binaries. Then
> you can send emails full programatically. It should look like:
>
> set procedure to SendMaEx.cc additive
> EmailMsg = new EmailEx()
> EmailMsg.Dest = "username@domain.ext"
> EmailMsg.ccDest = ""
> EmailMsg.bccDest = ""
> EmailMsg.Subject = "Title / Subject"
> EmailMsg.Message = "Enter your message here..."
> EmailMsg.Attachments.add("FileName1.ext")
> EmailMsg.Send()
> close procedure SendMaEx.cc
>
> In the last versions of outlook there are security issues and you have to
> click on OK twice.
>
> cu
> Bernd



Bernd Hohenester

2005-11-24, 3:23 am

Hello Dan,

> I tried SendMaEx.cc and got a warning dialog from Outlook say that some
> program was trying to send mail on my account and may be a virus. I have to
> answer questions; but, it finally sends the message after it closes Outlook.


These are the security issues in the newer versions. There is software
called redemption, which allows you, to use outlook without clicking OK.

> I have two situation in which I want this to work. (1) We have an
> interactive website for quoting insurance premiums. When the user finally
> selects the options to bind the coverage a response screen comes up with
> information about the policy. I want the application to automatically send
> an email to the underwriter announcing the submission. (2) In another
> application I want to send batch messages to pre-selected clients. In this
> case the body of the email needs to be .html with a link for a .pdf version.
> Is this capable of doing all these things?


For this purposes you better use a third party product. Look in the
folder <programs> \dBASE\Plus\web\mess
ageserver. There you find a copy of
see4db from MarshallSoft. Inspect the code in mailprocess.cc to
understand how to use it.

cu
Bernd
Dan Anderson

2005-11-28, 7:24 am

Okay, I downloaded Outlook Redemption but have no idea how to use it with
dBase. What needs to happen to make this work?



--
Dan Anderson
UBI Processing Dept.
andersond@ubinc.com
800-444-4824 ext 101
"Bernd Hohenester" <bernd. hohenester@directbox
.com> wrote in message
news:ALYPwOL8FHA.1492@news-server...
> Hello Dan,
>
>
> These are the security issues in the newer versions. There is software
> called redemption, which allows you, to use outlook without clicking OK.
>
>
> For this purposes you better use a third party product. Look in the folder
> <programs> \dBASE\Plus\web\mess
ageserver. There you find a copy of see4db
> from MarshallSoft. Inspect the code in mailprocess.cc to understand how to
> use it.
>
> cu
> Bernd



Bernd Hohenester

2005-11-28, 7:24 am

Hello Dan,

> Okay, I downloaded Outlook Redemption but have no idea how to use it with
> dBase. What needs to happen to make this work?


Sorry, i don't use it and can not offer any help.

cu
Bernd
Jan Hoelterling

2005-11-29, 8:24 pm

To work with Outlook, you would need code similar to the following: (cut
from some other code, so it does not run exactly like this)

m = new OLEAutoClient("Outlook.Application")
item = m.CreateItem(0) //zero is the constant for
mail item
for i=1 to this.recipients.size
item.recipients.Add(this.recipients[i])
next i
item.cc=this.cc
item.bcc=this.bcc
item.subject = this.subject
if empty(this.altbody)
item.body = this.text
for i=1 to this.attachments.size
item.attachments.add(this.attachments[i])
next i
else
item.body = this.altbody
endif
item.send()
release item
if type("m.Assistant") <> 'O'
m.quit()
endif
release m

I took a glance at redemption, I am not sure how you would need to adapt
this. If I understood correctly, the difference should be just in how "m"
and "item" in the above example are instantiated...

Hope this helps - please let me know how you make out - I may need this,
too.

Jan


Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com