webCOMAND

mail::attach()

Add an attachment to the email.

Prototype

void attach(string $filename, string $file)

Parameters

  • filename - Filename to associate with the attachment.
  • file - String containing the file contents.

Example

$mail = new \io_comand_email\mail(
    'webmaster@webcomand.com',
    'Testing',
    "This is a test.\nTesting 1, 2, 3."
);
$mail->attach('test.txt', 'This is a text file attachment.');
$mail->send();