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
通過不同的形式,我假設你的意思是一種不同的電子郵件發送方法。您是否查看過「SMTP」(請參閱https://en.wikipedia.org/wiki/Simple_Mail_Transfer_Protocol)。另外,您可能希望從帖子中刪除電子郵件地址。 – Gareth
看看這個集合:[7命令行實用程序使用SMTP輕鬆發送電子郵件](https://www.raymond.cc/blog/sending-email-using-command-line-useful-for-downtime-alert -通知/) –