PHPMailer问题与收件人

时间:2014-09-13 14:15:11

标签: php email smtp phpmailer

我使用PHPMailer向一个或多个detinations发送一些电子邮件。 但是我遇到了一个问题。来了: 这是我的代码:

      $mail2->AddAddress($cliemail);
      $mail2->AddCC('important@destination.com');
      $mail2->SetFrom('important@destination.com', "...");
      $mail2->AddReplyTo('important@destination.com', "...");
      $mail2->Subject = 'Email subject... '.$wnume;
      $mail2->AltBody = 'To be able to see this email please...'; 
      $mail2->MsgHTML(file_get_contents('contents.html'));
      $mail2->AddAttachment('teste/quiz.pdf'); // attachment
      $mail2->Send();
    } catch (phpmailerException $e) {
      echo $e->errorMessage(); //Pretty error messages from PHPMailer
    } catch (Exception $e) {
      echo $e->getMessage(); //Boring error messages from anything else!
    }

所以,我的电子邮件必须从 important@destination.com 发送(当然这是另一封电子邮件) 并且它被发送到$ cliemail,但它没有到达CC( important@destination.com ) 显然我不能给自己发电子邮件......这是正常的吗?

可能是什么原因?

我尝试删除AddCC并尝试直接将电子邮件发送到 important@destination.com 但仍未到达。

为了能够收到我自己的电子邮件,我必须在电子邮件帐户中设置一些设置吗?

所以:

  1. 当我使用上述内容将电子邮件发送到第三方电子邮件地址时 代码,它的工作原理
  2. 当我向自己(发件人)发送电子邮件时(与#34; SetFrom&#34相同的地址),它不会到达
  3. 即使我使用我的地址设置CC,它仍然没有到达,而它到达主目的地地址($ cliemail)
  4. 请帮忙

0 个答案:

没有答案