2015-09-01 178 views
0

訪問可以輕鬆使用Outlook,但我的電腦沒有Outlook。我可以使用,而不是另一種形式?我們公司只使用gmail,因此我需要在點擊表單上的按鈕後連接到gmail。發送無Outlook電子郵件

我的按鈕代碼:

Private Sub Gmail_Click() 

    Dim olApp As Object 
    Dim objMail As Object 

    On Error Resume Next 'Keep going if there is an error 
    Set olApp = GetObject(, "Outlook.Application") 'See if Outlook is open 

    If Err Then 'Outlook is not open 
     Set olApp = CreateObject("Outlook.Application") 'Create a new instance 
    End If 
    'Create e-mail item 
    Set objMail = olApp.CreateItem(olMailItem) 

    With objMail 
    'Set body format to HTML 
    .BodyFormat = olFormatHTML 
    .To = "[email protected]" 
    .Cc = "[email protected]" 
    .Subject = "Subject LIne" 
    .HTMLBody = "<htmltags>Body Content</htmltags>" 
    .send 
    End With 

    MsgBox "Operation completed successfully" 

End Sub 
+0

通過不同的形式,我假設你的意思是一種不同的電子郵件發送方法。您是否查看過「SMTP」(請參閱​​https://en.wikipedia.org/wiki/Simple_Mail_Transfer_Protocol)。另外,您可能希望從帖子中刪除電子郵件地址。 – Gareth

+0

看看這個集合:[7命令行實用程序使用SMTP輕鬆發送電子郵件](https://www.raymond.cc/blog/sending-email-using-command-line-useful-for-downtime-alert -通知/) –

回答

0

我找到了答案後解決。我只是創建一個帶有超鏈接地址的標籤,我們可以在其中設置文本到diplay,電子郵件地址,主題。所以如果你點擊這個標籤,它會導致像Gmail這樣的標準郵件系統。我希望這對其他人有幫助。

相關問題