2016-08-12 9 views
1

私はinmotionホスティングのVPSを持っていますが、確認メールを送信しますが、メールを送信するにはあまりにも多くの時間がかかります。私はパフォーマンスを向上させることができます。PHPメールが非常にゆっくり送信されます

これは私のコードです。

$subject = 'Mail activation'; 

$body = ' 
    <html> 
     <head> 
      <base target="_blank"> 
     </head> 
     <body> 
      <table style="max-width:800px; margin:0 auto; font-family: Arial, Helvetica, sans-serif;" cellspacing="0" cellpadding="10"> 
       <thead style="border-bottom:1px solid #DDD;"> 
        <tr> 
         <td align="center" style="border-bottom:1px solid #DDD;"> 
          <img src="http://p.unid.com/img/logoSASENegro.png" alt="" height="45" width="150"/> 
         </td> 
        </tr> 
       </thead> 
       <tbody> 
        <tr> 
         <td> 
          Hi classmate 
         </td> 
        </tr> 
        <tr> 
         <td> 
          Press the following link. 
         </td> 
        </tr> 
        <tr> 
         <td> 
          www.google.com 
         </td> 
        </tr> 
        <tr> 
         <td> 
          You data: 
         </td> 
        </tr> 
        <tr> 
         <td> 
          ID - <b>'.$ids.'</b><br/> 
          Password - <b>'.$pass.'</b><br/> 
         </td> 
        </tr> 
        <tr> 
         <td> 
          Don't response this email. 
         </td> 
        </tr> 
       </tbody> 
      </table> 
     </body> 
    </html> 
'; 

$headers = "MIME-Version: 1.0\r\n"; 
$headers .="Content-type: text/html; charset=utf-8\r\n"; 
$headers .= "From: Contacto SASE <[email protected]>\r\n"; 

if(mail($emailC, $subject, $body, $headers)) 
+0

構文に誤りがあります。 「このメールに返信しない」を見てください。あなたの文字列はそこで終わります。 – Joshua

+1

パフォーマンスは、サーバーではなくサーバー/ MTAセットアップに関連しています。 (→オフトピック)。しかし、メールクラスと適切なSMTPリレーを考えてみましょう。 – mario

答えて

0

一部のサーバーでは、電子メールが実際に遅く送信されました。あなたの問題はメッセージの内容に関連するものではなく、ホスティングプロバイダに関連しています。可能な解決策として、スクリプトを別のSMTPサーバー(たとえば、gmail:Send email using the GMail SMTP server from a PHP page)経由でメールを送信するように切り替えることができます。

関連する問題