2010-12-07 147 views
0

我使用PHPmailer從網站向網站所有者發送電子郵件。它對一些地址(例如我的Gmail帳戶)可以正常工作,並且它曾經適用於所有者的地址,但他最近從POP更改爲IMAP,現在他沒有收到來自網站的電子郵件。他確實收到來自其他來源的電子郵件。這是代碼:PHP電子郵件到IMAP帳戶

$mail = new PHPMailer(true);  

    try { 
      $mail->AddAddress($to, 'Example To'); 
      $mail->SetFrom('[email protected]', 'Example'); 
      $mail->AddReplyTo('[email protected]', 'Example'); 
      $mail->Subject = $subject; 
      $mail->AltBody = 'To view the message, please use an HTML compatible email viewer!'; // optional - MsgHTML will create an alternate automatically 
      $mail->MsgHTML($message); 
      $mail->Send(); 
      //echo "Message Sent OK</p>\n"; 
     } catch (phpmailerException $e) { 
      echo $e->errorMessage(); //Pretty error messages from PHPMailer 
     } catch (Exception $e) { 
      echo $e->getMessage(); //Boring error messages from anything else! 
     } 

任何意見非常讚賞。 謝謝! G

回答

1

那有什麼都沒有跟PHP代碼有關。 IMAP協議只是負責以用戶的身份從服務器獲取郵件(使用IMAP郵件停留在服務器上......您有長時間的開放流......)。
因此:他切換到另一個電子郵件提供商嗎?也許它是垃圾郵件。檢查maillog! ;-)

+0

感謝您的回覆 - 我會深入瞭解一下轉換過程中發生的情況。 – GluePear 2010-12-07 15:15:22

相關問題