试试
Dim o As New Microsoft.Office.Interop.Outlook.Application
Dim msg As Microsoft.Office.Interop.Outlook.MailItem
msg = o.CreateItem(Microsoft.Office.Interop.Outlook.OlItemType.olMailItem)
msg.BodyFormat = Microsoft.Office.Interop.Outlook.OlBodyFormat.olFormatHTML
msg.Recipients.Add("spring.me@qq.com") '收件人郵件地址
msg.Subject = "采购单" '郵件主旨
Dim body As String = "<html><body>内容</body></html>"
Dim bmp As new Bitmap("D:\1.jpg") '图片路径
Dim ms As new System.Io.MemoryStream()
bmp.Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg)
Dim arr(ms.Length) As Byte
ms.Position = 0
ms.Read(arr, 0, ms.Length)
ms.Close()
Dim strbase64 As String = Convert.ToBase64String(arr)
bmp.dispose
Dim content As String ="<img style = ""height:50px"" src=""data:image/jpeg;base64," & strbase64 & """ > "
msg.HTMLBody = body.Replace("内容", "这儿可点击进入: "& content)
msg.Attachments.Add("d:\test.txt") '添加採購訂單pdf件為附件
msg.Send()