diff --git a/src/PHPMailer.php b/src/PHPMailer.php index d18c2fbe1..8a50d06b4 100644 --- a/src/PHPMailer.php +++ b/src/PHPMailer.php @@ -3354,7 +3354,7 @@ public function addStringAttachment( $this->attachment[] = [ 0 => $string, 1 => $filename, - 2 => static::mb_pathinfo($filename, PATHINFO_EXTENSION), + 2 => static::mb_pathinfo($filename, PATHINFO_BASENAME), 3 => $encoding, 4 => $type, 5 => true, // isStringAttachment