dongtuo4132 2018-11-29 07:44
浏览 51

PHP exec操作不运行我的电子邮件脚本的最新版本

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?

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥100 为什么这个恒流源电路不能恒流?
    • ¥15 有偿求跨组件数据流路径图
    • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
    • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
    • ¥15 CSAPPattacklab
    • ¥15 一直显示正在等待HID—ISP
    • ¥15 Python turtle 画图
    • ¥15 关于大棚监测的pcb板设计
    • ¥15 stm32开发clion时遇到的编译问题
    • ¥15 lna设计 源简并电感型共源放大器