以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- 发送邮件携带附件 (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=187975) |
-- 作者:漂亮美眉vszh -- 发布时间:2023/8/24 15:47:00 -- 发送邮件携带附件 Dim mail As New System.Net.Mail.MailMessage() \' Dim client As New System.Net.Mail.SmtpClient() Dim Result As DialogResult Dim dz As String = drs(kii)("域名") Dim dk As String = drs(kii)("端口") Dim zh As String = drs(kii)("账号") Dim mm As String= drs(kii)("密码") Dim smtp As New System.Net.Mail.SmtpClient(dz,dk) smtp.Credentials = New System.Net.NetworkCredential(zh,mm) mail.Subject = zt mail.SubjectEncoding = System.Text.Encoding.GetEncoding("GB2312") mail.BodyEncoding = System.Text.Encoding.GetEncoding("GB2312") mail.From = New System.Net.Mail.MailAddress(fj,"EAPQP系统自动发送:" & tb1.value) mail.Priority = System.Net.Mail.MailPriority.Normal mail.IsBodyHtml = True mail.Body = nr 这是之前在哪抄的邮件发送的代码 现在想中附件,请问下老师加附件的代码怎么写 |
-- 作者:漂亮美眉vszh -- 发布时间:2023/8/24 15:47:00 -- 想中=想添加附件 |
-- 作者:漂亮美眉vszh -- 发布时间:2023/8/24 15:48:00 -- mail.AddAttachments(File) 报错 编译错误:“AddAttachments”不是“System.Net.Mail.MailMessage”的成员。 |
-- 作者:有点蓝 -- 发布时间:2023/8/24 16:17:00 -- http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&Id=140192 https://learn.microsoft.com/zh-CN/dotnet/api/system.net.mail.attachment?view=netframework-4.5
|