php - why the mail doesnt send automatically? -


the idea send mails automatically users when left day expire suscription.

$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  = 'info@vulpini.co' . ', '; // note 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>         ';          // send html mail, content-type header must 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 <info@vulpini.co>' . "\r\n";         $headers .= 'from: administrador <administrador@fightclubbogota.com>' . "\r\n";          // mail         mail($to, $subject, $message, $headers);      } 

why reason doesnt work?, think logic right don't sure, if rightly.

i hope can me.

thanks much.

it's quite difficult tell without knowing "$ayer" , "$datomespazysalvo[2]" types , values are.

for whole piece:

$enviar = $datomespazysalvo[2] - $ayer; if($enviar == 1) 

i'd recommend encapsulate logic function "shouldsendemail" can unit test , make sure right output every time:

if(shouldsendemail(){ ... } 

Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -