I recently discovered that when using the vbSendMail DLL to send multiple long filename attachments, the email message will not be sent because the DLL can not handle the long filenames.

As a workaround, you must convert long filenames to their equivalent short (DOS 8.3) filenames.

Private Declare Function GetShortPathName Lib "kernel32" _
Alias "GetShortPathNameA" _
ByVal lpszLongPath As String, _
ByVal lpszShortPath As String, _
ByVal cchBuffer As Long) As Long

Public Function ShortFileName(ByVal LongFileName As String) As String
Dim strBuffer As String * 255
Dim lngResult As Long

lngResult = GetShortPathName(LongFileName, strBuffer, Len(strBuffer))

ShortFileName = Left$(strBuffer, lngResult)
End Function

Private WithEvents poSendMail As vbSendMail.clsSendMail

Private Sub Form_Load()
Set poSendMail = New clsSendMail
End Sub

Private Sub SendEmail()
With poSendMail
.Delimiter = ";"
.Attachment = ShortFileName(txtAttachment1.txt) & .Delimiter & ShortFileName(txtAttachment2.txt)
End With
End Sub