将发送邮件的副本保存在“发送"信箱 [英] Save copy of sending mail in "Send" Mail Box
本文介绍了将发送邮件的副本保存在“发送"信箱的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想在发送"邮箱中保存发送邮件的副本.我正在使用此代码发送邮件.邮件已成功发送.
Dim ChkDateMail As New DataAccessLayer Dim email As New System.Net.Mail.MailMessage Dim GmailSmptp As New SmtpClient GmailSmptp.Host = "smtp.gmail.com" GmailSmptp.EnableSsl = true GmailSmptp.Credentials = New Net.NetworkCredential(SenderEmailAddress, SenderEmailPassword) email.To.Add(txtEmailTo.Text.Trim) email.From = New System.Net.Mail.MailAddress(SenderEmailAddress) email.Subject = txtEmailSubject.Text.Trim email.IsBodyHtml = True email.Body = txtEmailBody.Text.Trim GmailSmptp.Send(email)
解决方案
简而言之,您不能将已发送的电子邮件放入在线帐户的已发送邮件文件夹中,而必须使用电子邮件客户端就像Outlook,这会将它放入Outlook发送的项目中
使用Outlook发送电子邮件 [ ^ ]
将电子邮件地址添加到 MailMessage.Bcc [ ^ ],它将收到电子邮件的副本.
您需要将DeliveryMethod属性设置为Network.
Smtp传递方法 [Dim ChkDateMail As New DataAccessLayer Dim email As New System.Net.Mail.MailMessage Dim GmailSmptp As New SmtpClient GmailSmptp.Host = "smtp.gmail.com" GmailSmptp.EnableSsl = true GmailSmptp.Credentials = New Net.NetworkCredential(SenderEmailAddress, SenderEmailPassword) email.To.Add(txtEmailTo.Text.Trim) email.From = New System.Net.Mail.MailAddress(SenderEmailAddress) email.Subject = txtEmailSubject.Text.Trim email.IsBodyHtml = True email.Body = txtEmailBody.Text.Trim GmailSmptp.Send(email)解决方案In a nutshell you can''t put sent emails into a online account''s sent mail folder, you would have to use an email client like outlook and this will put it into the outlooks sent items
Send an email with Outlook[^]
Add the email address to MailMessage.Bcc[^] that will receive a copy of the email.
you need to set the DeliveryMethod property to Network.
Smtp Delivery Method[^]
这篇关于将发送邮件的副本保存在“发送"信箱的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文