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

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

      <i id='ck2LZ'><tr id='ck2LZ'><dt id='ck2LZ'><q id='ck2LZ'><span id='ck2LZ'><b id='ck2LZ'><form id='ck2LZ'><ins id='ck2LZ'></ins><ul id='ck2LZ'></ul><sub id='ck2LZ'></sub></form><legend id='ck2LZ'></legend><bdo id='ck2LZ'><pre id='ck2LZ'><center id='ck2LZ'></center></pre></bdo></b><th id='ck2LZ'></th></span></q></dt></tr></i><div id='ck2LZ'><tfoot id='ck2LZ'></tfoot><dl id='ck2LZ'><fieldset id='ck2LZ'></fieldset></dl></div>
        <bdo id='ck2LZ'></bdo><ul id='ck2LZ'></ul>
      1. <legend id='ck2LZ'><style id='ck2LZ'><dir id='ck2LZ'><q id='ck2LZ'></q></dir></style></legend>
      2. 邮件未发送给 CC 中的人

        时间:2023-07-02

          <tbody id='URDXB'></tbody>
            <bdo id='URDXB'></bdo><ul id='URDXB'></ul>

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

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

                  本文介绍了邮件未发送给 CC 中的人的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我有以下使用 python 发送邮件的脚本

                  I have the following script for sending mails using python

                  import smtplib
                  from email.mime.multipart import MIMEMultipart
                  from email.mime.text import MIMEText
                  import os
                  
                  FROMADDR = "myaddr@server.com"
                  PASSWORD = 'foo'
                  
                  TOADDR   = ['toaddr1@server.com', 'toaddr2@server.com']
                  CCADDR   = ['ccaddr1@server.com', 'ccaddr2@server.com']
                  
                  # Create message container - the correct MIME type is multipart/alternative.
                  msg            = MIMEMultipart('alternative')
                  msg['Subject'] = 'Test'
                  msg['From']    = FROMADDR
                  msg['To']      = ', '.join(TOADDR)
                  msg['Cc']      = ', '.join(CCADDR)
                  
                  # Create the body of the message (an HTML version).
                  text = """Hi  this is the body
                  """
                  
                  # Record the MIME types of both parts - text/plain and text/html.
                  body = MIMEText(text, 'plain')
                  
                  # Attach parts into message container.
                  msg.attach(body)
                  
                  # Send the message via local SMTP server.
                  s = smtplib.SMTP('server.com', 587)
                  s.set_debuglevel(1)
                  s.ehlo()
                  s.starttls()
                  s.login(FROMADDR, PASSWORD)
                  s.sendmail(FROMADDR, TOADDR, msg.as_string())
                  s.quit()
                  

                  当我使用脚本时,我看到邮件同时发送到 toaddr1toadd2但是 ccaddr1ccaddr2 根本没有收到邮件.

                  When I use the script, I see that the mail gets delivered to both toaddr1 and toadd2 However ccaddr1 and ccaddr2 does not receive the mail at all.

                  有趣的是,当我检查 toaddr1toadd2 收到的邮件时,它表明ccaddr1ccaddr2 存在于 CC 中.

                  Interestingly, when I check the mails received by toaddr1 and toadd2, it shows that ccaddr1 and ccaddr2 are present in CC.

                  脚本有错误吗?最初我认为这可能是我的邮件服务器的问题.我用 Gmail 试了一下,看到了同样的结果.也就是说,无论是我当前邮件服务器中的帐户,还是我在 CC 中的 Gmail 帐户,收件人都不会收到邮件,即使收件人"字段中的人正确接收邮件并且具有中提到的正确地址抄送字段

                  Is there any error in the script? Initially I thought that this might be an issue with my mail server. I tried it with Gmail and saw the same result. That is, no matter whether its an account in my current mail server or my Gmail account in the CC, the recipient will not receive the mail, even though the people in the 'To' field receive it properly and have the correct addresses mentioned in the CC field

                  推荐答案

                  我觉得发邮件的时候需要把CCADDR和TOADDR放在一起:

                  I think that you will need to put the CCADDR with the TOADDR when sending the mail:

                  s.sendmail(FROMADDR, TOADDR+CCADDR, msg.as_string())
                  

                  您在邮件中正确添加了地址,但您还需要信封上的抄送地址.

                  You're correctly adding the addresses to your message, but you will need the cc addresses on the envelope too.

                  来自 docs:

                  注意 from_addr 和 to_addrs 参数用于构造传输代理使用的消息信封.

                  Note The from_addr and to_addrs parameters are used to construct the message envelope used by the transport agents.

                  这篇关于邮件未发送给 CC 中的人的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:服务器不支持 SMTP AUTH 扩展 下一篇:Hotmail SSL3 版本号错误使用 smtp

                  相关文章

                  <legend id='EHxwF'><style id='EHxwF'><dir id='EHxwF'><q id='EHxwF'></q></dir></style></legend>
                  1. <small id='EHxwF'></small><noframes id='EHxwF'>

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

                      <tfoot id='EHxwF'></tfoot>