Trouble attaching file to email using MAPI control
I'm writing an error logger component for an application that I want to be
able to send an error log file to our developers. I'm using the MAPI control
for this (VB6 SP3, Win2000 RC1)
I can get it to send an email message correctly but am having trouble
attaching the log file to the document. My code for sending looks like:
Private Sub cmdSend_Click()
On Error GoTo errhandler
Dim fso As Scripting.FileSystemObject
Set fso = New Scripting.FileSystemObject
If fso.FileExists(g_logFile) Then
.RecipDisplayName = txtRecip.Text
.MsgSubject = "Error Report"
.AttachmentIndex = 0
.AttachmentType = mapData
.AttachmentPathName = g_logFile
.AttachmentName = "Error Report"
.AttachmentPosition = 0
.MsgReceiptRequested = True
MsgBox "No Error Log to Send", vbApplicationModal +
If I comment out the Attchemnt code the lessage gets sent without trouble.
Without it commented I get an "Unspecified Error" from the MAPI control when
the send method is invoked.
Am I doing something wrong here? The log file exists and the specified path