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 33 34 35 36 37 38 39 40 41 42 43 44 45 46
|
Dim ObjOutlk As New outlook.Application
ObjMail = ObjOutlk.CreateItem(outlook.OlItemType.olMailItem) 'Email item
Dim myItem As outlook.MailItem = ObjMail
'Dim myInspectors As outlook.Inspectors = Nothing
Dim myInspectors As outlook.Inspector = CType(inspectors, outlook.Inspector)
Dim mailItem As outlook.MailItem = Nothing
ObjMail.Display()
'Dim myinspector As outlook.Inspector
Dim strHTML As String = ""
strHTML = strHTML & "<HEAD>"
strHTML = strHTML & "<BODY>"
strHTML = strHTML & "Bonjour , <BR>Blabla blalala :<BR><BR>"
strHTML = strHTML & "<TABLE BORDER>"
ObjMail.Display()
'---------------------
ObjMail.Subject = "Mon sujet"
ObjMail.To = "Destinataire"
strHTML = ""
strHTML = strHTML & "<HEAD>"
strHTML = strHTML & "<BODY>"
strHTML = "<p><span style='color:#1F497D'>Bonjour " & My_client & ",</p>" & Chr(13) & _
"<p> Blablabla </p>" & Chr(13) & _
"<p> Blablabla</P>" & Chr(13) & _
"<p> Blablabla</p>" & Chr(13) & _
"<p>J Blablabla<br>" & _
"<p>Cordialement,<br><br><br>
strHTML = strHTML & "</BODY>"
ObjMail.HTMLBody = strHTML
svname = "C:\Users\" & Environ("USERNAME") & "\Desktop\Mon dossier mail\"
ObjMail.SaveAs(svname & "Notification.msg", outlook.OlSaveAsType.olMSG)
'ObjMail.Display(False)
mailItem = CType(myInspectors.CurrentItem, outlook.MailItem)
Marshal.ReleaseComObject(mailItem)
'myItem = myInspectors.CurrentItem
'myItem.Close()
myItem.Close(1) |
Partager