PHPMailer checks is_file
for every attachment (in addAttachment
function, in class.phpmailer.php file):
if (!@is_file($path)) {
throw new phpmailerException($this->lang('file_access') . $path, self::STOP_CONTINUE);
}
My problem is that I can make work is_file
only giving full local path to file, not URLs:
is_file('C:/wamp/www/myFolder/rocks.png'); //True
is_file('http://localhost/myFolder/rocks.png'); //False :(
So I can't attach any file from the remote server.
What am I doing wrong?? It can be a permission issue?
EDIT:
I know that there are other ways to check if file exists.
But is_file
is in the PhpMailer library, I prefer to not touch it and I want to know if it's possible to make it work using its methods.
Thanks.
get_headers
to check remote file existence. – Lavonna