使用.NET SmtpClient 添加密件抄送到电子邮件发送?

发布于 2024-08-25 07:44:36 字数 84 浏览 4 评论 0原文

在 ASP.NET C# 中使用 SMTPClient 类发送电子邮件时,如何向电子邮件添加密件抄送?如何将密件抄送添加到 MailMessage 实例?

When sending email using the SMTPClient class in ASP.NET C#, how can I add bcc to the email? How can I add bcc to a MailMessage instance?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

寂寞美少年 2024-09-01 07:44:36
MailAddress addressTo = new MailAddress("[email protected]");
MailAddress addressFrom = new MailAddress("[email protected]");
MailAddress addressBCC = new MailAddress("[email protected]");

MailMessage MyMessage = new MailMessage(addressFrom, addressTo );
MyMessage.Bcc.Add(addressBCC);
MailAddress addressTo = new MailAddress("[email protected]");
MailAddress addressFrom = new MailAddress("[email protected]");
MailAddress addressBCC = new MailAddress("[email protected]");

MailMessage MyMessage = new MailMessage(addressFrom, addressTo );
MyMessage.Bcc.Add(addressBCC);
猫瑾少女 2024-09-01 07:44:36

您正在寻找名称恰当的 密件抄送属性

message.Bcc.Add("[email protected]");

You're looking for the aptly-named Bcc property:

message.Bcc.Add("[email protected]");
梦言归人 2024-09-01 07:44:36

在这里我将解释如何使用 asp.net c# 应用程序通过抄送和密件抄送发送电子邮件

 MailMessage mailMessage = new MailMessage(smtpUser, toAddress);
 if (!string.IsNullOrEmpty(cc))
 {
    mailMessage.CC.Add(cc);
 }
 if (!string.IsNullOrEmpty(bcc))
 {
    mailMessage.Bcc.Add(bcc);
 }

对于完整示例 http://www.stepover-f10.com/2014/01/how-send-email-with-cc-and-bcc-with-authentication-using-aspnet- csharp-example-source-code.aspx
单击此链接。

Here i will explain how to send email with cc and bcc using asp.net c# application.

 MailMessage mailMessage = new MailMessage(smtpUser, toAddress);
 if (!string.IsNullOrEmpty(cc))
 {
    mailMessage.CC.Add(cc);
 }
 if (!string.IsNullOrEmpty(bcc))
 {
    mailMessage.Bcc.Add(bcc);
 }

For full example http://www.stepover-f10.com/2014/01/how-send-email-with-cc-and-bcc-with-authentication-using-aspnet-csharp-example-source-code.aspx
click this link.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文