You can't use the SendObject function to send an email via Mozilla
Thunderbird, you need to use the Shell command.
Create a code module and paste the code below into it and save it as
modThunderbird (or whatever you prefer).
'-------------------------------------------------------------------------------------
Public Sub SendTBirdMail(vRecipients As String, vSubject As String, _
vBody As String, vAttachments As String)
'Entry (vRecipients) = Semicolon delimited string of recipients.
' (vSubject) = Message subject.
' (vBody) = Body of the message.
' (vAttachments) = List of comma delimited files to attach
Dim vTBird As String, vInLine As String
On Error GoTo ErrorCode
vTBird = "C:\Program Files\Mozilla Thunderbird\thunderbird.exe"
'set pathname of email program
vAttachments = Replace(vAttachments, ",", ", File:///")
vAttachments = " File:///" & vAttachments
vInLine = " -compose to=" & vRecipients _
& ",subject=" & vSubject _
& ",body=" & vBody _
& ",attachment=" & Chr(39) & vAttachments & Chr(39)
Call Shell(vTBird & vInLine, vbMaximizedFocus)
Exit Sub
ErrorCode:
MsgBox Err.Description
End Sub
'-------------------------------------------------------------------------------------
Watch out for line wrapping.
The string variable vTBird should be changed to hold the pathname to
the Thunderbird program on your hard disk.
Just call the routine like this :-
SendTBirdMail "(e-mail address removed)","Subject text","Body
text","C:\Temp\Filename.txt"
If you have more than one recipient email address then use a
semi-colon between each one and if you want to send multiple
attachments, they should be separated by commas.
See these Web sites (if you haven't already) for more info :-
http://kb.mozillazine.org/Command_line_arguments_(Thunderbird)
and the Thunderbird forum at :-
http://forums.mozillazine.org/index.php?sid=8772cc0984b1ae855d90d5c266db3a7f
HTH
Peter Hibbs.