VBA
Outlook users:
Public Sub SendMail(iv_user_id_hr As String)
Dim appOutlook As New Outlook.Application
Dim objMailtemplate As Outlook.MailItem
Dim objMail As Outlook.MailItem
Set objMailtemplate = GetCurrentOutlookMail()
Set objMail = appOutlook.CreateItem(olMailItem)
With objMail
.To = iv_user_id_hr
.Recipients.ResolveAll
.CC = ""
.BCC = ""
.Subject = objMailtemplate.Subject
.Body = objMailtemplate.Body
.BodyFormat = objMailtemplate.BodyFormat
.HTMLBody = objMailtemplate.HTMLBody
.Importance = objMailtemplate.Importance
.ReminderSet = objMailtemplate.ReminderSet
.ReminderTime = objMailtemplate.ReminderTime
.VotingOptions = objMailtemplate.VotingOptions
.VotingResponse = objMailtemplate.VotingResponse
If frm_mailing_wizard.chk_do_not_send = False Then
.Send
Else
.Display
End If
End With
End Sub
------------
via URL:
Public Declare Function ShellExecute Lib "shell32.dll" _
Alias "ShellExecuteA" (ByVal hwnd As Long, _
ByVal lpOperation As String, ByVal lpFile As String, _
ByVal lpParameters As String, ByVal lpDirectory As String, _
ByVal nShowCmd As Long) As Long
Public Sub OpenURL(url As String, Optional ByVal ShowMode As OpenUrlShowConstants = swNormal)
ShellExecute GetDesktopWindow(), "Open", url, "", "", ShowMode
End Sub
...
If lv_url <> "" Then
OpenURL (lv_url)
End If
...
for lv_url use this syntax:
lv_url = 'mailto:' && lv_address_to && '&subject=' && iv_subject && '&body=' && lv_body