Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
MAPI problem!
Message
From
14/03/1997 17:42:18
Paul Watson
Mcv Global Systems, Inc.
Pasadena, California, United States
 
 
To
11/03/1997 16:38:08
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Title:
Miscellaneous
Thread ID:
00023792
Message ID:
00024333
Views:
36
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform