Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to email outllook with attachments
Message
From
02/03/2004 09:04:44
 
 
To
01/03/2004 20:53:46
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00882218
Message ID:
00882311
Views:
18
how can i add attachments to this email? or is there any better code to send email using outlook with attachments?
#DEFINE olMailItem   0
#define olOriginator 0
#define olTo         1
#define olCC         2
#define olBCC        3

loOutlook = CREATEOBJECT( 'Outlook.Application' )
loMsg = loOutlook.CreateItem( olMailItem )
IF VARTYPE( loMsg ) = 'O'
  WITH loMsg
    *** Set the required message properties
    .Subject = "This is a test message"
    .Body = "Here are some attachments"
    *** Add the recipients
    loRecipient = .Recipients.Add( "someone@somedomain.com" )
    loRecipient.Type = olTo         
    *** And finally, add the attachment 
    .Attachments.Add( "d:\MyFullPath\MyDocument.zip" )
    *** And send it off
    .Send()
  ENDWITH
ENDIF
Previous
Reply
Map
View

Click here to load this message in the networking platform