1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
| Sub test_CreateNewMessage()
CreateNewMessage "Nom", "To@destinataire.fr", "C:\TEMP\capture.PNG", "cc@destinataire.fr"
End Sub
Private Sub CreateNewMessage(strContactName, strContactTo, strFName, Optional strContactCC)
' Create a new message with the following inputs :
If DIR(strFName) <> "" Then
Set OL_Mail = CreateItem(0)
With OL_Mail
.To = strContactTo
If strContactCC <> "" Then
.CC = "test@domain1.com"
End If
.Subject = sSubject
.Body = sBody
.BodyFormat = 1 'Format : 0=undetermined; 1=plain text; 2= HTML; 3=rich text
.Importance = 2 'Importance : 0=low; 1=normal; 2= high
.Sensitivity = 3 'Confidentiality : 0=normal; 1=personal; 2=private; 3=confidential
.Attachments.add (strFName)
' Display or send the message
.Display
'.Send
End With
End If
Set OL_Mail = Nothing
End Sub |