Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to send email via FoxPro???
Message
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Title:
How to send email via FoxPro???
Miscellaneous
Thread ID:
00735256
Message ID:
00735256
Views:
43
Below is an exctract of code I found to for sending email. How would I attach a file to the email? Is there a better way?

* Send mail to a user=============================

strProfile = "MyUserID"
strPassword = "MyPassWord"
public strRecipient[2]
strRecipient[1] = "MyUserID@domain.com"
strRecipient[2] = "Reciepent@domain.com"
strSubject = "AutoMail - Distribution Test"
PUBLIC lcBody
lcBody = ''
PUBLIC lcLines[2]
lcLines[1] = "LIPCA Insurance Group : Auto-Mail Router *** DO NOT REPLY TO THIS MESSAGE ***"+Chr(13)
lcLines[2] = Replicate('=',Len(lcLines[1]))+Chr(13)


theApp = CreateObject("Outlook.Application")
theNameSpace = theApp.GetNameSpace("MAPI")
theNameSpace.Logon(strProfile , strPassword)
theMailItem = theApp.CreateItem(0)

theMailItem.Recipients.Add( strRecipient[1] )
theMailItem.Recipients.Add( strRecipient[2] )
theMailItem.Subject = strSubject
theMailItem.Body = lcBody
theMailItem.Send
theNameSpace.Logoff
Best Regards,
Lee Roy J. Pitre, Jr, AAS, BA, MS
Pitre Computer Consultant & Associates
http://pitres.us
Next
Reply
Map
View

Click here to load this message in the networking platform