• <legend id='N0S8c'><style id='N0S8c'><dir id='N0S8c'><q id='N0S8c'></q></dir></style></legend>

    <i id='N0S8c'><tr id='N0S8c'><dt id='N0S8c'><q id='N0S8c'><span id='N0S8c'><b id='N0S8c'><form id='N0S8c'><ins id='N0S8c'></ins><ul id='N0S8c'></ul><sub id='N0S8c'></sub></form><legend id='N0S8c'></legend><bdo id='N0S8c'><pre id='N0S8c'><center id='N0S8c'></center></pre></bdo></b><th id='N0S8c'></th></span></q></dt></tr></i><div id='N0S8c'><tfoot id='N0S8c'></tfoot><dl id='N0S8c'><fieldset id='N0S8c'></fieldset></dl></div>

          <bdo id='N0S8c'></bdo><ul id='N0S8c'></ul>
      1. <tfoot id='N0S8c'></tfoot>

      2. <small id='N0S8c'></small><noframes id='N0S8c'>

        如何使用 System.Net.Mail 向多个地址发送电子邮件

        时间:2023-10-06
      3. <legend id='ATHNx'><style id='ATHNx'><dir id='ATHNx'><q id='ATHNx'></q></dir></style></legend>

            <tbody id='ATHNx'></tbody>

            <small id='ATHNx'></small><noframes id='ATHNx'>

            <i id='ATHNx'><tr id='ATHNx'><dt id='ATHNx'><q id='ATHNx'><span id='ATHNx'><b id='ATHNx'><form id='ATHNx'><ins id='ATHNx'></ins><ul id='ATHNx'></ul><sub id='ATHNx'></sub></form><legend id='ATHNx'></legend><bdo id='ATHNx'><pre id='ATHNx'><center id='ATHNx'></center></pre></bdo></b><th id='ATHNx'></th></span></q></dt></tr></i><div id='ATHNx'><tfoot id='ATHNx'></tfoot><dl id='ATHNx'><fieldset id='ATHNx'></fieldset></dl></div>
            1. <tfoot id='ATHNx'></tfoot>

                  <bdo id='ATHNx'></bdo><ul id='ATHNx'></ul>

                  本文介绍了如何使用 System.Net.Mail 向多个地址发送电子邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我有 smtp 电子邮件功能.它适用于单个地址,但在多个地址中存在问题.

                  I have smtp email functionality. it works for single address but has problem in multiple address.

                  我正在使用以下代码行传递多个地址.

                  i am passing multiple addresses using following line of code.

                  MailAddress to = new MailAddress("abc@gmail.com,xyz@gmail.com");
                  

                  请让我知道问题,因为我没有收到任何错误.

                  Please let me know the problem as i am not getting any error.

                  推荐答案

                  MailMessage msg = new MailMessage();
                  msg.Body = ....;
                  msg.To.Add(...);
                  msg.To.Add(...);
                  
                  SmtpClient smtp = new SmtpClient();
                  smtp.Send(msg);
                  

                  To 是一个MailAddressCollection,所以你可以添加你需要的地址.

                  To is a MailAddressCollection, so you can add how many addresses you need.

                  如果您需要显示名称,请尝试以下操作:

                  If you need a display name, try this:

                  MailAddress to = new MailAddress(
                      String.Format("{0} <{1}>",display_name, address));
                  

                  这篇关于如何使用 System.Net.Mail 向多个地址发送电子邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:通过 Google Apps 帐户通过 C# 发送电子邮件 下一篇:测试 SMTP 服务器正在通过 C# 运行

                  相关文章

                  <small id='Q4z0U'></small><noframes id='Q4z0U'>

                • <tfoot id='Q4z0U'></tfoot>

                      <i id='Q4z0U'><tr id='Q4z0U'><dt id='Q4z0U'><q id='Q4z0U'><span id='Q4z0U'><b id='Q4z0U'><form id='Q4z0U'><ins id='Q4z0U'></ins><ul id='Q4z0U'></ul><sub id='Q4z0U'></sub></form><legend id='Q4z0U'></legend><bdo id='Q4z0U'><pre id='Q4z0U'><center id='Q4z0U'></center></pre></bdo></b><th id='Q4z0U'></th></span></q></dt></tr></i><div id='Q4z0U'><tfoot id='Q4z0U'></tfoot><dl id='Q4z0U'><fieldset id='Q4z0U'></fieldset></dl></div>
                    1. <legend id='Q4z0U'><style id='Q4z0U'><dir id='Q4z0U'><q id='Q4z0U'></q></dir></style></legend>
                        <bdo id='Q4z0U'></bdo><ul id='Q4z0U'></ul>