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
| Dim sFilePath As String
Dim ext As String
ConvertTabPage_BMP(TabPage1, sFilePath, ext)
Dim Outlook As Outlook.Application
Dim Mail As Outlook.MailItem
Dim Acc As Outlook.Account
Outlook = New Outlook.Application()
Mail = CType(Outlook.CreateItem(Microsoft.Office.Interop.Outlook.OlItemType.olMailItem), Outlook.MailItem)
Mail.To = "essai@essai.com"
Mail.Subject = "essai ABC"
For Each Acc In Outlook.Session.Accounts
If Acc.AccountType = Microsoft.Office.Interop.Outlook.OlAccountType.olPop3 Then
Mail.Sender = CType(Acc, Outlook.AddressEntry)
End If
Next
Mail.Attachments.Add("C:\Users\All Users\ABC.jpeg")
' Mail.HTMLBody = "Bonjour,"
Mail.Body = "Bonjour,
Voici les dernières nouvelles.
Merci,
Cordialement,"
Mail.Display()
Catch ex As Exception
MessageBox.Show("Opération annulée par l'utilisateur !", "Envoyer un e-mail", MessageBoxButtons.OK, MessageBoxIcon.Information)
End Try
End Sub |
Partager