Re: VFP 9: Outlook and Extended MAPI



Ok, so you use outlook as I see.
So you want to validate the e-mail address before sending it?
Once the e-mail is filled with the code you are using, it is tool late to validate the e-mail address. I would suggest you use a VFP form for the user to fill the information, and when he hits the send button, do your e-mail address validation then, and then send the e-mail.


"Gene Wirchenko" <genew@xxxxxxxx> wrote in message news:9c9025hkq40g84ldtcp9kdmj75h2c16r3h@xxxxxxxxxx
"Mike Gagnon" <mikegagnon@xxxxxxxxxxxxxxxx> wrote:

How are you sending the e-mail?
A VFP form or outlook?

I do not understand your question. I am sending it with:

***** Start of Included Code *****
#define olMailItem 0

#define olTo 1
#define olCC 2
#define olBCC 3

local ooutlook, omailitem
ooutlook=createobject("Outlook.Application")

omailitem=ooutlook.CreateItem(olMailItem)

with omailitem

* .From=alltrim(csysshad.fromem) && no such property
.Subject=theclcode+".Invoice (from Int'l Market Access,
Inc.)"
.Body=embody

with .Recipients

local clines, i, whom, fresolved

clines=memlines(cclishad.emto)
for i=1 to clines
emaddr=mline(cclishad.emto,i)
if !empty(emaddr)
whom=.Add(emaddr)
whom.Type=olTo
endif
endfor

clines=memlines(cclishad.emcc)
for i=1 to clines
emaddr=mline(cclishad.emcc,i)
if !empty(emaddr)
whom=.Add(emaddr)
whom.Type=olCC
endif
endfor

fresolved=.ResolveAll()
endwith

if !fresolved
if !empty(statusmsg)
statusmsg=statusmsg+CHRCR
endif
if justone
statusmsg=statusmsg+;
"Warning: Access was unable to resolve all E-mail addresses for this
client."
else
statusmsg=statusmsg+;
"Warning: Access was unable to resolve all E-mail addresses for client
";
+theclcode+"."
endif
endif

for i=1 to cemfiles
.Attachments.Add(epdir+"\"+emflist(i,1))
&& This is correct as epdir is where the emflist files
now are.
endfor

endwith

if fsaveem
omailitem.Save()
endif

if fsendem
omailitem.Send()
endif

omailitem=.null.
ooutlook=.null.
***** End of Included Code *****

[snip]

Sincerely,

Gene Wirchenko

Computerese Irregular Verb Conjugation:
I have preferences.
You have biases.
He/She has prejudices.

.



Relevant Pages

  • Re: Email code sample
    ... > ENDIF ... > ENDFOR ... In Outlook, delete each message after it's processed or move it to ... >>> TIA for any help. ...
    (microsoft.public.fox.programmer.exchange)
  • Re: Grid on a form
    ... ENDIF ... to validate the input, in pseudo code, very roughly ... lots of details involved here might make a separate ... be more intuitive for the user and for us it's easier to control ...
    (microsoft.public.fox.vfp.forms)
  • Re: Grid on a form
    ... >> I meant to say after I append blank and replaced data in the first ... > ENDIF ... > to validate the input, in pseudo code, very roughly ... > be more intuitive for the user and for us it's easier to control ...
    (microsoft.public.fox.vfp.forms)
  • [PATCH 17/18] rtmutex-tester: make it build without BKL
    ... that if it is disabled by Kconfig, ... try to validate it, which would result in ... +#ifdef CONFIG_LOCK_KERNEL ...
    (Linux-Kernel)
  • Re: how to recreate indexes?
    ... > SET COLLATE TO 'MACHINE' ... > ENDIF ... > database. ...
    (microsoft.public.fox.helpwanted)