Hi Kengwen,
Try the following:
oleMAPISession = CREATEOBJECT( "MSMAPI.MAPISession.1" )
* Signon to mail
WITH oleMAPISession
.UserName = ""
.PASSWORD = ""
.Signon()
* Check the SignOn status
IF (.SessionID > 0)
oleMAPIMessages = CREATEOBJECT( "MSMAPI.MAPIMessages.1" )
* tell the message the SessionID
oleMAPIMessages.SessionID = .SessionID
ELSE
RETURN
ENDIF
ENDWITH
* Send an email
WITH oleMAPIMessages
.Compose()
* Set the Recipient name and resolve
.RecipDisplayName = "
abc@yahoo.com"
.RecipType = 1
.ResolveName()
.MsgSubject = "Testing"
.MsgNoteText ="Hello dear"
*.AttachmentName="c:\error.log" && commented out, name set next line
.AttachmentPathName="c:\error.log" && Full path and filename
.SEND(.F.) &&<---- DEBUG stop AT here
ENDWITH
* Signoff
oleMAPISession.Signoff()
It might not work with Outlook express but it's worth a try. I've run it through on Outlook 2000 and as long as the attachment is present it's fine.
All I have changed is the .AttachmentPathName value, this property seems to need a full path and filename for the attachment.
You could try Nigel Coates' (?) Mapimail.vcx which I believe maybe in the UT downloads section.
Hope this helps,
Ben
Ben Sugden
"Remember to enjoy hunting - and that means relishing the search for the product that has never been advertised or placed handily at the front of the shop; Life begins on the uppermost shelf, avoid guide books and top 10's like the plague." - Ramsey Dukes