我正在尝试使用 mime->addAttachment() 将附件添加到我要发送的电子邮件中
相对路径:../../clientdata/client1/attachments/file.txt
直接路径:/home/hosting/site.eu/html/ssl/clientdata/client1/attachments/file.txt
脚本位置:/home/hosting/site.eu/html/ssl/work/php_scripts/send_email.php
send_email.php 使用以下命令执行:
exec("php /home/hosting/site.eu/html/ssl/work/php_scripts/send_email.php");
我在这里缺少什么吗?
我用来添加附件的代码:
$f = 'ssl.site.eu/clientdata/client1/attachments/file1.txt';
$arr_file = explode('/', $f, 2);
$file_path = '/home/hosting/site.eu/html/ssl/'.$arr_file[1]; //this works
// $file_path = '../../'.$arr_file[1]; // this doesn't work;
$mime->addAttachment($file_path,'application/octet-stream');