让我的发件人选择是否发送附件

时间:2019-03-02 23:25:47

标签: php phpmailer sender

任何人都知道我的发件人会怎样? ,尝试选择是否发送附件

df1 <- read.table(header=T, text="Date             Time    ColumnA    ColumnB
01/01/2013      08:00      10         30
01/01/2013      08:30      15         25
01/01/2013      09:00      20         20
02/01/2013      08:00      25         15
02/01/2013      08:30      30         10
02/01/2013      09:00      35         5")

df2 <- read.table(header=T, text="Date           ColumnA    ColumnB    ColumnC
01/01/2013      100        300         1
02/01/2013      200        400         2")

那是来自MKSENDERS的,发件人自身if ($makassarid_setup['filesend'] == 1) { $filepdf = file_get_contents($AddAttachment); $mail->AddAttachment($filepdf); } 来自mks.setting.php作为配置文件,它已作为MKSENDERS文件的顶部包含在内 如您在$makassarid_setup上看到的 如果我在mks.setting.php文件if ($makassarid_setup['filesend'] == 1) {上(在mks.setting.php上)设置了1,它应该正在发送附件,但是当我执行发送器

时,它给了我输出
"filesend"       => 1,

当我打开PHP Notice: Undefined variable: AddAttachment in /home/ubuntu/workspace/DEATHhomo/MKSENDERS on line 125 PHP Warning: file_get_contents(): Filename cannot be empty in /home/ubuntu/workspace/DEATHhomo/MKSENDERS on line 125. 时,它将正常发送电子邮件,没有任何错误输入,并且"filesend" => 0,来自mks.setting.php $filepdf,因此文件名不为空当然,我非常感谢您的帮助。

非常感谢! :D

2 个答案:

答案 0 :(得分:0)

            if ($makassarid_setup['filesend'] == 1) {
            $takeattachmentfromtheconfig = $makassarid_setup['filepdf']
            $callingtheattachmentabove = file_get_contents($takeattachmentfromtheconfig);
            $mail->AddAttachment($callingtheattachmentabove;
        }

这是对的吗?

答案 1 :(得分:0)

PHPMailer只需要文件名,而不是其内容,因此似乎您想要:

if($makassarid_setup['filesend']==1){
    $mail->AddAttachment($filepdf);
}