求vb发送图片邮件代码(最好把工程发到我的邮箱里面359388685@qq.com)
可以把E:\123.jpg发送到指定的邮箱里面
高分跪求了啊
Ps:是不是原创的代码无所谓,但是希望各位答题的高手先自己试试程序能不能成功再发上来啊)
求vb发送图片邮件代码(最好把工程发到我的邮箱里面359388685@qq.com)
可以把E:\123.jpg发送到指定的邮箱里面
高分跪求了啊
Ps:是不是原创的代码无所谓,但是希望各位答题的高手先自己试试程序能不能成功再发上来啊)
发了已经
其实可以以附件方式发送的
太码太多,只能给你发主要部分了
FORM通用声明中:Private WithEvents poSendMail As vbSendMail.clsSendMail Private WithEvents poSendMail1 As vbSendMail.clsSendMail Private WithEvents poSendMail2 As vbSendMail.clsSendMail Option Compare Text Dim bAuthLogin As Boolean Dim bHtml As Boolean Dim MyEncodeType As ENCODE_METHOD
'发送
With poSendMail .SMTPHostValidation = VALIDATE_HOST_DNS ' Optional, default = VALIDATE_HOST_DNS .EmailAddressValidation = VALIDATE_SYNTAX ' Optional, default = VALIDATE_SYNTAX .SMTPHost = Text1 '服务器 .From = Text3 '发送者帐号 .FromDisplayName = Text2 ' 发送者姓名 .Recipient = Text8 '对方信箱 .RecipientDisplayName = IIf(Len(Text10) = 0, Text8, Text10) ' 对方称呼" .CcRecipient = "" ' 抄送 .CcDisplayName = "" ' 抄送 .BccRecipient = "" '抄送 .ReplyToAddress = "" ' 抄送 .Subject = Text4 '主题 .Message = Text7 '信息内容 .Attachment = Trim(Text5) '附件文件
.AsHTML = IIf(ckHtml.Value = 1, True, False) ' Optional, default = FALSE, send mail as html or plain text .ContentBase = "" ' Optional, default = Null String, reference base for embedded links .EncodeType = MyEncodeType ' Optional, default = MIME_ENCODE .UseAuthentication = IIf(ckLogin.Value = 1, True, False) ' Optional, default = FALSE .UserName = txtUserName ' Optional, default = Null String .Password = txtPassword ' Optional, default = Null String, value is NOT saved .Send ' Required End With