SendObject without Outlook

S

SMoeller

How to sent an email in VBA via SendObject without using Outlook (no mail
profile created). My company only uses Thunderbird? PLEASE help? Thanks
 
T

Tom van Stiphout

On Tue, 11 Aug 2009 21:44:01 -0700, SMoeller

Never heard of T-Bird, but it's up to them to provide you with the
interface and documentation needed to send an email. Contact them and
let us know how you fare.

-Tom.
Microsoft Access MVP
 
P

Peter Hibbs

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.
 
M

Mark Andrews

You could just use a simple smtp component, there are about a dozen out
there.
I like this one (you need to use the previous version):
http://www.ostrosoft.com/

I have used aspmail in the past it works well.

Then just supply the info needed to send smtp mail (server/login etc...) and
it doesn't matter what email programs are installed.

Most smtp components are one dll (some need registered, some don't). They
support everything you would ever need to do with mail.

HTH,
Mark
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top