Dears,
I am using the following code to create an email using VBA (my client is Thunderbird).
I can create the email properly (destination, subject, etc), but I am struggling to attach files. I have checked Mozilla forums for command line syntax but no success.
This is the code I am using:
Sub test()
sCmd = "C:\Program Files (x86)\Mozilla Thunderbird\thunderbird"
Email = "[email protected]" 'fake email, change to a real one
Subject = "Test message"
Content = "Check this out"
attch = "C:/anyfile.pdf" 'fake file name and path, change to a real one
'
sCmd = sCmd & " -compose " & Chr$(34) & "mailto:" & Email & "?"
sCmd = sCmd & "subject=" & Chr$(34) & Subject & Chr$(34)
sCmd = sCmd & "&attachment=" & Chr$(34) & "file:///" & attch & Chr$(34)
sCmd = sCmd & "&body=" & Content
Call Shell(sCmd, vbNormalFocus)
End Sub
As I said above, the email pops up properly filled, but no success in attaching the proper file.
Thanks in advance.
Bookmarks