Send email: Difference between revisions
Content added Content deleted
(+VBA) |
|||
Line 1,419: | Line 1,419: | ||
{{omit from|zkl}} |
{{omit from|zkl}} |
||
{{omit from|ZX Spectrum Basic|Does not have network access.}} |
{{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}}== |
=={{header|VBScript}}== |