John,
I think you have to call ResolveName() even though you supply an email address and not a name to look up. I don't bother setting AttachmentPosition. This has some other junk from my class because I keep an VFP array of filenames
with this.oleMAPIMessages
this.mnAttachmentCount = this.mnAttachmentCount + 1
dimension this.maAttachments[this.mnAttachmentCount]
.AttachmentIndex = this.mnAttachmentCount - 1
.AttachmentPathName = pcFileName
i = rat( "\", pcFileName )
this.maAttachments[this.mnAttachmentCount] = substr( pcFileName, i+1 )
.AttachmentName = this.maAttachments[this.mnAttachmentCount]
.AttachmentType = 0
endwith</b>
>ThisForm.OLESessionMAPI
> .LogonUI=.F.
> .NewSession=.F.
> .Username="TestUsername"
> .Password="TestPassword"
>
> .SignOn()
>ENDWITH
>
>WITH ThisForm.OLEMessageMAPI
> .SessionID = ThisForm.OLESessionMAPI.SessionID
> .Compose()
>
> .MsgType = ""
> .MsgSubject = "CAMPAIGN FILES"
> .MsgNoteText = "Here it is..."
>
> .AttachmentIndex = .AttachmentCount + 1
> .AttachmentName = "Ca000001.txt"
> .AttachmentPathName = "C:\Email\Ca000001.txt"
> .AttachmentPosition = 12
> .AttachmentType = 0
>
> .RecipIndex = .RecipCount + 1
> .RecipAddress = "vlahosj@total.net"
> .RecipDisplayName = "John Vlahos"
> .RecipType=1
>
> .Send()
>ENDWITH
>
>ThisForm.OLESessionMAPI.SignOff
>ThisForm.Release()
>
><
>
>Thank you,
>John Vlahos