PHPMailer::addAttachment

Advertisement

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

$path

(string) (Required) Path to the attachment.

$name

(string) (Optional) Overrides the attachment name.

Default value: ''

$encoding

(string) (Optional) File encoding (see $Encoding).

Default value: 'base64'

$type

(string) (Optional) File extension (MIME) type.

Default value: ''

$disposition

(string) (Optional) Disposition to use

Default value: 'attachment'

Return Return

(boolean)

Source Source

File: wp-includes/class-phpmailer.php


			

Advertisement

Advertisement

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.