Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
E-mail attachement from VFP application via Outlook
Message
 
To
19/07/2004 17:10:23
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Miscellaneous
Thread ID:
00925892
Message ID:
00925943
Views:
24
Perhaps this.
#DEFINE CdoFileData  1 && ReadFromFile method Attachment is a file (Default value) 
#DEFINE CdoFileLink  2 &&Source property  Attachment is a link to a file 
#DEFINE CdoOLE  3 &&ReadFromFile method  Attachment is an OLE object 
#DEFINE CdoEmbeddedMessage  4 &&ID property of the Message object to be embedded  Attachment is an embedded message 
#DEFINE  CdoDefaultFolderOutbox  2
oSession = CreateObject('MAPI.Session')
oSession.Logon('Microsoft Outlook Internet Settings','<password>')
oFolder=oSession.GetDefaultFolder(CDODefaultFolderOutBox)
oMessage=oFolder.Messages.add()
oAttachment = oMessage.Attachments.Add()
oAttachment.Position = 0  && Important to position the attachement
oAttachment.Type = CdoFileData
oAttachment.ReadFromFile( 'c:\autoexec.bat')
oAttachment.Source = 'c:\autoexec.bat'
oAttachment.Name = 'autoexec.bat'
oMessage.Update()
oMessage.Send()
oSession.LogOff
>Hi Michael,
>
>Here is my code:
>
>lo=CREATEOBJECT("mabry.smtpxctl.1")
>lo.AuthenticationType=1
>lo.ConnectionType = 1
>lo.Blocking = .t.
>lo.Host = "my host"
>lo.LogonName = "my email address"
>lo.LogonPassword = "my password"
>lo.Connect()
>
>When I execute my code the error message is:
>"OLE IDispatch exception code 0 from Mabry.SMTPx.1 The requested connection
>has been refused by the remote host..."
>
>Thanks, Gregory
Previous
Reply
Map
View

Click here to load this message in the networking platform