Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Adding attachments to an e-mail via FoxPro
Message
From
04/05/1998 13:46:30
 
 
General information
Forum:
Visual FoxPro
Category:
Internet applications
Miscellaneous
Thread ID:
00096771
Message ID:
00096782
Views:
14
>Does anyone know how to automatically add an attachment to an e-mail generated by FoxPro (using the Windows OLE)?
>
>Thanks in advance
>
>Jorge Ferreira
>cardinal2@mail.telepac.pt

It's just a sample:
if type('oSession')<>"O"
	oSession=createobject("MAPI.Session")
	oSession.Logon("MS Exchange Settings",.f.)
endif
oMessage=oSession.OutBox.Messages.Add()
oMessage.Subject="Email Test"
oMessage.Text="Skol'ko mozhno zhdat'"
oAttach=oMessage.Attachments.Add()
With oAttach
	.type=1
	.name="c:\temp\text1.txt"
	.readfromfile("c:\temp\text1.txt")
endwith
oAttach.name="text1.txt"
oRecipient=oMessage.Recipients.Add()
with oRecipient
	.Name="ed pikman"
	.Address="SMTP:epikman@usa.net"
	.AddressEntry.Type="SMTP"
	.AddressEntry.Address="epikman@usa.net"
endwith
oMessage.Update()
oMessage.Send(.t.,.f.)
Edward Pikman
Independent Consultant
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform