PHPMailer\PHPMailer

PHPMailer::attachmentExists()publicWP 1.0

Check if an attachment (non-inline) is present.

Method of the class: PHPMailer{}

No Hooks.

Return

true|false.

Usage

$PHPMailer = new PHPMailer();
$PHPMailer->attachmentExists();

PHPMailer::attachmentExists() code WP 6.5.2

public function attachmentExists()
{
    foreach ($this->attachment as $attachment) {
        if ('attachment' === $attachment[6]) {
            return true;
        }
    }

    return false;
}