Foxtable(狐表)用户栏目专家坐堂 → 请问如何在outlook调用发送邮件增加签名图片


  共有3419人关注过本帖树形打印复制链接

主题:请问如何在outlook调用发送邮件增加签名图片

帅哥,在线噢!
有点蓝
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:110792 积分:563898 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2021/4/20 9:55:00 [显示全部帖子]

试试

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()


 回到顶部