I'm doing something really simple, and getting some unintended results. I'm running a simple exec operation in my php script (called emailsetup.php
), and it's running a simple php script that writes an email (called email.php
). It's sending the email, but when I modify my email php script, it always sends the original email text from yesterday.
I've tried a bunch of different iterations on the exec command, but all of them send the first version of my email. When I edit the subject string and save email.php
, then run the emailsetup.php
script in my browser, it always sends the original email. It's confounding, because I haven't used that version of the email strings in hours.
The codes are really simple: (emailsetup.php
)
<?php
exec('echo "email 2>&1" | at now + 1 minute');
and (email.php
)
<?php
$to = 'me@myemail.com';
$subject = '[Testing 06]';
$message = 'Message testing 06';
$headers = 'From: my2@myemail.com' . "
" .
'Reply-To: my2@myemail.com' . "
" .
'X-Mailer: PHP/' . phpversion();
if(mail($to, $subject, $message, $headers)) {
echo 'Email successfully sent [test 6]';
}
?>
When I run the php file in my browser, it echoes the latest number (in this case 6), but when I check my emails, they always show the "test 1" subject and body. So the exec is finding the latest up-to-date email.php file. But the email is not sending properly. How can I get the operation to forget the older versions?