Summery Summery

Add an attachment from a path on the filesystem.

Syntax Syntax

PHPMailer::addAttachment( string $path, string $name = '', string $encoding = 'base64', string $type = '', string $disposition = 'attachment' )

Description Description

Never use a user-supplied path to a file! Returns false if the file could not be found or read. Explicitly does not support passing URLs; PHPMailer is not an HTTP client. If you need to do that, fetch the resource yourself and pass it in via a local file or string.

Parameters Parameters


(Required) Path to the attachment.


(Optional) Overrides the attachment name.

Default value: ''


(Optional) File encoding (see $Encoding).

Default value: 'base64'


(Optional) File extension (MIME) type.

Default value: ''


(Optional) Disposition to use

Default value: 'attachment'

Return Return


Source Source

File: wp-includes/class-phpmailer.php




Leave a Reply