我正在制作视觉基本电子邮件软件这个软件发送附件文件和邮件我想发送邮件许多公司我添加到字段但我想添加BCC和CC邮件系统也包括但它不知道如何我为此编码..如果任何人对此有很好的认识,请给我一个想法.... 或任何其他方式添加倍数邮件系统与Doc CV文件的附件....我还需要知道添加过滤器,有人不添加任何其他格式文件发送。但主要是我需要知道如何添加BCC vb和CC碳复制系统中的盲抄送系统..
答案 0 :(得分:-1)
Imports System.Net
Imports System.Net.Mail
Private mpMessage As MailMessage = Nothing
Private mpSMTPSvr As SmtpClient = Nothing
'------------------------------------------------------------------------
'-> Send The Message
'------------------------------------------------------------------------
MailerHost = "Addrss-of-your-emailer-host-server"
mpMessage = New System.Net.Mail.MailMessage()
mpMessage.Body = "Message body text goes here"
If Trim(SenderNameValue) <> "" Then
mpMessage.From = New System.Net.Mail.MailAddress("senderemail@hotmail.com", SenderNameValue)
mpMessage.Sender = New System.Net.Mail.MailAddress("senderemail@hotmail.com", SenderNameValue)
Else
mpMessage.From = New System.Net.Mail.MailAddress("senderemail@hotmail.com", "Name_Unspecified")
mpMessage.Sender = New System.Net.Mail.MailAddress("senderemail@hotmail.com", "Name_Unspecified")
End If
mpMessage.Priority = System.Net.Mail.MailPriority.High
mpMessage.Subject = "[WEB-REPONSE] - Correspondence via Website response form."
mpMessage.To.Add(Trim("recipient@yahoo.com"))
mpMessage.CC.Add(Trim("secretary@yahoo.com"))
mpMessage.BCC.Add(Trim("manager@yahoo.com"))
Try
mpSMTPSvr.Send(mpMessage)
SendStandardCommunicae = True
Catch ex As Net.Mail.SmtpException
ReturnErrorid = eEML_NETWORKERRORSENDINGEMAIL
ReturnErrorText = "A network error occurred whilst trying to send your message, please check your details for syntax errors and try again later.<br />If the error occurs consistently please contact the site administrator or use an alternative method of contact.<br /><br />"
ReturnErrorText = ReturnErrorText & "Extra Information:" & ex.Message
End Try