php
  • email
  • cron
  • 2017-06-15 5 views -1 likes 
    -1

    コアphpにはcronジョブを書いてありますが、メール送信コードもあります。 ...作業cronジョブのメールコード(コアphp)はアップデートしていますが、メール送信は機能していません

    私のコード:

    <?php 
    .............. 
    .............. 
    $subject =  "Thank you"; 
    
             $message =  '<table border="0" cellpadding="0" cellspacing="0" width="600" style="font-family: Tahoma, Geneva, sans-serif;font-size: 13px;width:600px; margin:20px auto;"><tr bgcolor="#00ADEF"><td align="center" valign="top" width="100%" style="font-family: Tahoma, Geneva, sans-serif;font-size: 13px;"><table border="0" cellpadding="10" cellspacing="0" width="100%" style="font-family: Tahoma, Geneva, sans-serif;font-size: 13px;"><tr align="center"><td><img src="path/cronjobs/cron_mail_img/mailTempLogo.png" width="198" style="max-width:198px; margin-top: 30px; margin-bottom: 30px;" /></td></tr></table></td></tr><tr bgcolor="#f5f5f5"><td align="center" valign="top" width="100%" class="templateColumnContainer"><table border="0" cellpadding="10" cellspacing="0" width="100%" style="font-family: Tahoma, Geneva, sans-serif;font-size: 13px;"><tr><td class="templateColumnContainer" style="padding:0px 20px;"><p style="font-size:16px; margin-bottom:5px;"><strong>Hi '.$row['payer_fname'].', </strong></p><p style="font-size:16px; margin-bottom:5px;">Thank you for choosing.. !</p><p style="font-size:16px; margin-bottom:5px;">Hope you had a great time.</p><p style="font-size:16px; margin-bottom:5px;">Please share your experience with us by just rating the property where you were living.</p><p style="font-size:16px; margin-bottom:5px;">Please <a href="path/rating/rating.php?prp_id='.base64_encode($row['property_id']).'&usr_id='.base64_encode($row['user_id']).'">rate the property..!</a></p></td></tr><tr style="background-color: #f5f5f5;"><td style="padding:20px;"><p style="font-size:16px; margin:10px 0;">Thanks, </p><p style="font-size:16px; margin:10px 0;">Team XYZ </p></td></tr><tr align="center" style="background-color: #f5f5f5;"><td style="border-top:solid 1px #CCC"> <img src="path/cronjobs/cron_mail_img/ftr-logo.png" width="39" /></td></tr></table></td></tr></table>'; 
    
    
             $headers = "MIME-Version: 1.0" . "\r\n"; 
             $headers .= "Content-type:text/html;charset=UTF-8" . "\r\n"; 
             $headers .= 'From: Domain<[email protected]>' . "\r\n"; 
    
             mail($row['payer_email'], $subject, $message, $headers); 
    .............. 
    .............. 
    ?> 
    

    提案してください何か..あなたが渡すことはできません

    +0

    「メール送信は機能していません」とは何を意味するのですか? – arkascha

    +0

    エラーメッセージが表示されますか? httpサーバのエラーログファイルに何かが見えますか?あなたはSPAMフォルダにメッセージを受け取りますか?メッセージは返されますか? – arkascha

    答えて

    0

    チェック怒鳴るコードが電子メールで送信する

    $to = "[email protected]"; 
    $subject ="Thank you"; 
    
    $message = '<table border="0" cellpadding="0" cellspacing="0" width="600" style="font-family: Tahoma, Geneva, sans-serif;font-size: 13px;width:600px; margin:20px auto;"><tr bgcolor="#00ADEF"><td align="center" valign="top" width="100%" style="font-family: Tahoma, Geneva, sans-serif;font-size: 13px;"><table border="0" cellpadding="10" cellspacing="0" width="100%" style="font-family: Tahoma, Geneva, sans-serif;font-size: 13px;"><tr align="center"><td><img src="path/cronjobs/cron_mail_img/mailTempLogo.png" width="198" style="max-width:198px; margin-top: 30px; margin-bottom: 30px;" /></td></tr></table></td></tr><tr bgcolor="#f5f5f5"><td align="center" valign="top" width="100%" class="templateColumnContainer"><table border="0" cellpadding="10" cellspacing="0" width="100%" style="font-family: Tahoma, Geneva, sans-serif;font-size: 13px;"><tr><td class="templateColumnContainer" style="padding:0px 20px;"><p style="font-size:16px; margin-bottom:5px;"><strong>Hi '.$row['payer_fname'].', </strong></p><p style="font-size:16px; margin-bottom:5px;">Thank you for choosing.. !</p><p style="font-size:16px; margin-bottom:5px;">Hope you had a great time.</p><p style="font-size:16px; margin-bottom:5px;">Please share your experience with us by just rating the property where you were living.</p><p style="font-size:16px; margin-bottom:5px;">Please <a href="path/rating/rating.php?prp_id='.base64_encode($row['property_id']).'&usr_id='.base64_encode($row['user_id']).'">rate the property..!</a></p></td></tr><tr style="background-color: #f5f5f5;"><td style="padding:20px;"><p style="font-size:16px; margin:10px 0;">Thanks, </p><p style="font-size:16px; margin:10px 0;">Team XYZ </p></td></tr><tr align="center" style="background-color: #f5f5f5;"><td style="border-top:solid 1px #CCC"> <img src="path/cronjobs/cron_mail_img/ftr-logo.png" width="39" /></td></tr></table></td></tr></table>'; 
    
    // Always set content-type when sending HTML email 
    $headers = "MIME-Version: 1.0" . "\r\n"; 
    $headers .= "Content-type:text/html;charset=UTF-8" . "\r\n"; 
    
    // More headers optional/headers 
    $headers .= 'From: <[email protected]>' . "\r\n"; 
    $headers .= 'Cc: [email protected]' . "\r\n"; 
    
    mail($to,$subject,$message,$headers); 
    
    +0

    コードダンプは良い答えにはなりません。どのようにして*どうやって*彼らの問題を解決するか説明してください。私は読むことをお勧めします。 "[良い答えを書くにはどうすればいいですか?]](http://stackoverflow.com/help/how-to-answer) –

    +0

    これはよくある質問であり、重複して閉じる必要があります。それは答えられてはならない。将来、aには重複としてのみフラグを付けてください。 –

    +0

    また、フォーマットツールを悪用しないでください。 –

    関連する問題