2013-10-07 123 views
1

我面臨着一些問題,電子郵件發送,我正在探索波紋管腳本其他服務器。發送電子郵件問題與

try 
    { 
     $mail->Host  = "mail.xyz.com"; // SMTP server 
     $mail->SMTPDebug = 1;      // enables SMTP debug information (for testing) 
     $mail->SMTPAuth = true;     // enable SMTP authentication 
     $mail->Port  = 25;     // set the SMTP port for the GMAIL server 
     $mail->Username = "[email protected]"; // SMTP account username 
     $mail->Password = "mypassword";  // SMTP account password*/ 
     $mail->SetFrom($from, $fromName); 
     $mail->AddAddress($to, $toName); 
     $mail->Subject = $subject; 
     $mail->AddReplyTo('[email protected]', 'xyz title');   
     $mail->AltBody = 'To view the message, please use an HTML compatible  email viewer!'; // optional - MsgHTML will create an alternate automatically 
     $mail->MsgHTML($body); 
     $mail->IsHTML(true); // send as HTML 
     $success = $mail->Send(); 
    } 
    catch (phpmailerException $e) 
    { 
     echo $e->errorMessage(); 
    } 
    catch (Exception $e) 
    { 
     echo $e->getMessage(); 
    } 
    return $success; 

**我使用這個代碼的PHPMailer發送電子郵件它的正常工作向我

  • [email protected]

  • [email protected]

  • [email protected]

    但是當我將郵件發送到hotmail,如[email protected][email protected],然後發送到垃圾郵件文件夾。什麼應該是問題?此外,當我試圖在我公司的服務器一樣[email protected]發送電子郵件,然後得到以下錯誤:**

    --------------------- -------原始郵件---------------------------- 主題:郵件投遞失敗:將郵件退回給發件人 從:「郵件傳遞系統」 日期:星期一,2013年10月7日下午6時23 要:[email protected]


    是由郵件傳遞軟件自動創建該消息。

    您發送無法交付給一個或多個其 收件人的消息。這是一個永久性錯誤。以下地址失敗:

    [email protected] 
    SMTP error from remote mail server after MAIL FROM:<[email protected]> SIZE=1872: 
    host xyztechnologies.com [173.37.185.97]: 
    550 Access denied - Invalid HELO name (See RFC2821 4.1.1.1) 
    

    ------這是郵件的副本,包括所有標題。 ------

    返回路徑: 接收:從本地主機([127.0.0.1]:47913 HELO = www.xyz.com) 通過齒條與esmtpa(進出口4.80.1) (envelope-從) ID 1VT8up-0007gh-UD 爲[email protected]; Mon,07 Oct 2013 18:23:55 +0700 Received:from 122.177.170.230([122.177.170.230])(代表10.1.1.12) (SquirrelMail authenticated user [email protected]) by www。 xyz.com與HTTP; 星期一,2013年10月7日18時23分55秒0700 郵件ID:< [email protected]> 日期:星期一,2013年10月7日18時23分55秒0700 主題:測試來自網絡郵件 來自:[email protected] 到:[email protected] 用戶代理:SquirrelMail的/ 1.4.22 MIME-版本:1.0 內容類型:文本/無格式;字符集= ISO-8859-1 內容傳輸編碼:8位 X優先:3(正常) 重要性:普通

    TEsst2 
    

    應該是什麼問題?我無法找到任何解決方案。請幫幫我。 感謝

回答

0

一般來說,這有什麼都做郵件服務器和協議使用的是...使用sendmail通過PHP發送

郵件沒有被驗證,可以匿名發送...這可能是一個原因,你的電子郵件的都結束了陷入垃圾郵件文件夾...

我建議使用經驗證的smtp服務器在那裏驗證發件人的身份(這也需要匹配從頭),你將有更好的機會進入收件箱。

0

您需要包含FROM電子郵件,並且它需要來自發送的域,否則許多主機提供商會將其標記爲垃圾郵件。

這會起作用,因爲它將電子郵件標識爲已從您的域發送。 $ headers [] ='來自:某人也許你';

這不起作用,它會被標記爲垃圾郵件。 $ headers [] ='來自:某人也許你';