Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Outlook Formatting Problem
Message
 
À
13/01/2000 09:59:31
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00316600
Message ID:
00318423
Vues:
30
Scott,
It's pretty simple. I have a class with properties that hold the subject, body and list of file attachments. The email addresses are put into a cursor, since there are from 1 to 10 of them. Then it's just an OLE Automation call:
olapp = CreateObject('outlook.application')
olmessage = olapp.CreateItem(0)
WITH olmessage
   .subject = this.icsubject
   .body = this.icbody
	
   SELE curEMAIL  && Email addresses from a table.  Not all are good
   GO top
   lGoodMail = .f.
   SCAN
      cEmail = curEMAIL.EMAIL
      nAT = at('@',cEmail)
      nDot = rat('.', cEmail)

      IF nAT > 0 AND nDot > 0 AND nDot > nAT
         lGoodMail = .T.
      ELSE
         LOOP
      ENDIF
      ** Good email, go ahead
      .Recipients.add(cEmail)
      .Recipients(1).Type = 1
   ENDSCAN
      sele curattach   && cursor with attachments
      go top
      scan
      .attachments.add(fullname,1)
   endscan
   
   .SentOnBehalfOfName = allt(this.icSentBy) && Email address of sender
   IF !lGoodMail
      =messagebox("Email Addresses are not in correct format", 16, Email")
      lRet = .f.
   ELSE
      .send
      lRet = .t.
   ENDIF
ENDWITH
Release olmessage
Release olapp
HTH
Barbara

>Barabra, is there documentation for doing that. Is this somehitng you can share. I've been wanting to be able to email a quote with out using an OCX or DLL. I would greatly appreciate any information you can share that would help me to do this. Thank you for your time.
>
>Scott - vfp_info@cspstudios.com
Barbara Paltiel, Paltiel Inc.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform