-1
The code below causes the e-mail to be sent specifically to a particular e-mail specified in the variable $email_remetente
and basically if the time is greater than specified in the function: $dates->setTime(13,30,00);
it sends to another email.
The idea would be that every 30 minutes he changed the variable $email_remetente
to an email and after 30 minutes back to another email.
<?php
header('Content-Type: text/html; charset=utf-8');
date_default_timezone_set('America/Sao_Paulo');
$date = date('Y-m-d H:i');
$email_remetente = "[email protected]";
//altera email do remetente de acordo com a hora
$dates = new \DateTime();
$dates->setTime(13,30,00);
$dateNows = new \DateTime();
if($dateNows > $dates) {
$email_remetente = '[email protected]';
}
?>
"if time is greater than specified in function" ... an IF does not resolve !?
– Motta