2013-01-24 2 views
1

MS Outlook을 사용하여 전자 메일을 만들고 보내는 Excel에서 VB 매크로를 작성했습니다.Excel 매크로에서 Thunderbird 전자 메일 만들기

그래서 Outlook.Application을 만든 다음 Outlook.Application.CreateItem(olMailItem)을 만듭니다.

이 모든 것이 환상적으로 작동합니다. :)하지만 지금은 Outlook이 없어도 배포 할 수있는 컴퓨터가 있다는 것을 깨달았습니다. 라이센스가있는 Outlook의 복사본은 옵션이 아닙니다. 어떻게 Thunderbird를 통해 이메일을 보낼 수 있습니까?

나는이를 사용하여 응용 프로그램을 실행할 수 있습니다 :

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

을하지만 난 그것을 위해 메일 항목을 만들 수있는 방법을 모르겠어요. 특별히 Thunderbird를 사용할 필요가 없습니다. 무료 메일 클라이언트이기 때문에 선택했습니다.

+1

25에서 SMTP 포트를 변경하려고 서버에 연결하는 데 실패하지입니까? http://www.rondebruin.nl/cdo.htm –

+0

완벽하게 작동합니다! 고마워 – user1934821

답변

1

CDO는 옵션이 아닙니까? http://www.rondebruin.nl/win/s1/cdo.htm - 싯다 르트 나라 얀 패주

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 

참고 :이 오류가 나타나면 : CDO이 옵션은 전송 후 465

관련 문제