Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
MAPI problem!
Message
De
14/03/1997 17:42:18
Paul Watson
Mcv Global Systems, Inc.
Pasadena, Californie, États-Unis
 
 
À
11/03/1997 16:38:08
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Titre:
Divers
Thread ID:
00023792
Message ID:
00024333
Vues:
32
I finally got it working! I have included the code for you:

*-- Place a DBF file in the temp directory
cAttachName = 'MAD'+RIGHT(MadHatter.cFdr_Merch_No,5)+'.DBF'
cAttachSource = TRIM(GETENV('TEMP'))+'\'+cAttachName
SELECT MadMail
COPY TO (cAttachSource) TYPE FOX2X
USE
*-- Create the E-Mail message.
IF TYPE('oSession') <> 'O'
oSession = CREATEOBJECT('MAPI.Session')
oSession.Logon("Windows Messaging Settings",.f.)
ENDIF
*-- Create the email subject line.
cEmailSubject = 'Merchant Account Detail for '+DTOC(DATE())+'. File Number: '
cEmailSubject = cEmailSubject + RIGHT(MadHatter.cFdr_Merch_No,10)
*-- Create text to go in the actual email.
cEmailText = CRLF+MadWork.Name_Block+CRLF+CRLF
IF !EMPTY(TextBlock)
cEmailText = cEmailText + TextBlock+CRLF
ENDIF
oMessage = oSession.OutBox.Messages.Add()
oMessage.Subject = cEmailSubject
oMessage.Text = cEmailText
oAttach = oMessage.Attachments.Add()
WITH oAttach
.Type = 1
.Name = cAttachSource
.ReadFromFile(cAttachSource)
ENDWITH
oAttach.Name = cAttachName && Overwrite placeholder.
oRecipient = oMessage.Recipients.Add()
WITH oRecipient
.Name = TRIM(MadHatter.cEmail)
.Address = 'SMTP:'+TRIM(MadHatter.cEmail)
.AddressEntry.Type = "SMTP"
.AddressEntry.Address = TRIM(MadHatter.cEmail)
ENDWITH
oMessage.Update()
oMessage.Send(.T.,.F.)


Good Luck!
Paul Watson
MCV Computer Consultants
MCV Global Systems, Inc.
pWatson@PrimeNet.Com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform