从Excelmacros创buildThunderbird电子邮件

我已经在Excel中编写了一个VBmacros,它使用MS Outlook创build和发送电子邮件。

所以我创build一个Outlook.Application ,然后创build一个Outlook.Application.CreateItem(olMailItem)

这一切工作fantastically :)但现在我已经意识到我想部署它的机器没有Outlook,并获得Outlook的许可副本不是一个选项。 那么我怎样才能让这个邮件通过Thunderbird发送呢?

我可以使用这个启动应用程序:

 Dim RetVal RetVal = Shell("C:\Program Files (x86)\Mozilla Thunderbird\thunderbird.exe", 1) 

但我不知道如何为它创build一个邮件项目。 它不需要专门使用Thunderbird,我只是select它,因为它是一个免费的邮件客户端。

CDO不是一种select吗? http://www.rondebruin.nl/win/s1/cdo.htm – Siddharth Rout

 Sub CDO_Mail_Small_Text() Dim iMsg As Object Dim iConf As Object Dim strbody As String ' Dim Flds As Variant Set iMsg = CreateObject("CDO.Message") Set iConf = CreateObject("CDO.Configuration") ' iConf.Load -1 ' CDO Source Defaults ' Set Flds = iConf.Fields ' With Flds ' .Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 ' .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") _ ' = "Fill in your SMTP server here" ' .Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25 ' .Update ' End With strbody = "Hi there" & vbNewLine & vbNewLine & _ "This is line 1" & vbNewLine & _ "This is line 2" & vbNewLine & _ "This is line 3" & vbNewLine & _ "This is line 4" With iMsg Set .Configuration = iConf .To = "" .CC = "" .BCC = "" .From = "" .Subject = "New figures" .TextBody = strbody .Send End With End Sub 

注意:如果出现此错误:传输失败连接到服务器,然后尝试将SMTP端口从25更改为465