获得一个MAILMESSAGE发送到"发送文件夹" [英] Getting a sent MailMessage into the "Sent Folder"
问题描述
我要送MailMessages与SmtpClient使用Exchange Server,但想在我发送的电子邮件去,我从(不会发生),向他们发送的电子邮件地址的发送文件夹(被成功交付)。
I'm sending MailMessages with an SmtpClient (being delivered successfully) using an Exchange Server but would like my sent emails to go to the Sent Folder of the email address I'm sending them from (not happening).
using (var mailMessage = new MailMessage("fromaddress@blah.com", "toaddress@blah.com", "subject", "body"))
{
var smtpClient = new SmtpClient("SmtpHost")
{
EnableSsl = false,
DeliveryMethod = SmtpDeliveryMethod.Network
};
// Apply credentials
smtpClient.Credentials = new NetworkCredential("smtpUsername", "smtpPassword");
// Send
smtpClient.Send(mailMessage);
}
时有我丢失,这将确保所有我发送的电子邮件的配置从fromaddress@blah.com在他们的发送文件夹到?
Is there a configuration I'm missing that will ensure all of my sent emails from "fromaddress@blah.com" arrive in their Sent Folder?
推荐答案
我猜,你的要求是面向主要围绕给用户知名度,电子邮件已经发送了什么。发送邮件文件夹是一种方法,让这种情况发生。在过去,我已经加入了 BCC地址
这会从字面上直接发送电子邮件到一个通讯组列表,用户或共享,允许用户邮箱的解决了这个问题审查了哪些发送。
I'm guessing that your requirement is mainly oriented around giving the users visibility to what emails have been sent. The sent items folder would be one method to allow this to occur. In the past, I've solved this problem by adding a BCC Address
that would literally send the email directly to either a distribution list, user, or shared mailbox that allowed the users to review what had been sent.
通过某种Outlook规则试试这个将项目移至其发送邮件文件夹标记为已读...
Try this with an outlook rule of some kind to move the item to their sent items folder marked as read...
using (var mailMessage = new MailMessage(
"fromaddress@blah.com",
"toaddress@blah.com",
"",
"fromaddress@blah.com",
"subject",
"body"))
{
var smtpClient = new SmtpClient("SmtpHost")
{
EnableSsl = false,
DeliveryMethod = SmtpDeliveryMethod.Network
};
// Apply credentials
smtpClient.Credentials = new NetworkCredential("smtpUsername", "smtpPassword");
// Send
smtpClient.Send(mailMessage);
}
这篇关于获得一个MAILMESSAGE发送到"发送文件夹"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!