Send email: Difference between revisions

+VBA
(+VBA)
Line 1,419:
{{omit from|zkl}}
{{omit from|ZX Spectrum Basic|Does not have network access.}}
 
=={{header|VBA}}==
<lang vba>Option Explicit
Const olMailItem = 0
 
Sub SendMail(MsgTo As String, MsgTitle As String, MsgBody As String)
Dim OutlookApp As Object, Msg As Object
Set OutlookApp = CreateObject("Outlook.Application")
Set Msg = OutlookApp.CreateItem(olMailItem)
With Msg
.To = MsgTo
.Subject = MsgTitle
.Body = MsgBody
.Send
End With
Set OutlookApp = Nothing
End Sub
 
Sub Test()
SendMail "somebody@somewhere", "Title", "Hello"
End Sub</lang>
 
=={{header|VBScript}}==
Anonymous user