這個想法是當我的用戶離開一天到期時自動發送郵件給我的用戶。郵件爲什麼不自動發送?
$enviar = $datoMesPazysalvo[2] - $ayer;
if($enviar == 1){
$nombre = $row_registroClientes['nombres'] + $row_registroClientes['apellidos'];
$email = $row_registroClientes['correo'];
$telefono = $row_registroClientes['telefono'];
// multiple recipients
$to = '[email protected]' . ', '; // note the comma
$to .= '$email';
// subject
$subject = 'Fight Club Bogota, Información importante!!';
// message
$message = '
<html>
<head>
<title>Fight Club Bogota, Información importante!!</title>
</head>
<body>
<p>Tu matricula vence mañana $datoMesPazysalvo[2]</p>
<span>Ponte en contacto con nosotros para renovar</span>
</body>
</html>
';
// To send HTML mail, the Content-type header must be set
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
// Additional headers
$headers .= 'To: $nombres <$email>, Administrador <[email protected]>' . "\r\n";
$headers .= 'From: Administrador <[email protected]>' . "\r\n";
// Mail it
mail($to, $subject, $message, $headers);
}
這是爲什麼不工作的原因?我想的邏輯是正確的,但我並不完全確定,如果正確。
我希望有人能幫助我。
非常感謝。
什麼功能調用這個例程?如果它沒有被調用,它會自動執行嗎? – ArrowHead