public function PHPMailer::AddStringAttachment in SMTP Authentication Support 7.2
Same name and namespace in other branches
- 5 smtp.module \PHPMailer::AddStringAttachment()
- 7 smtp.phpmailer.inc \PHPMailer::AddStringAttachment()
Adds a string or binary attachment (non-filesystem) to the list. This method can be used to attach ascii or binary data, such as a BLOB record from a database.
Parameters
string $string String attachment data.:
string $filename Name of the attachment.:
string $encoding File encoding (see $Encoding).:
string $type File extension (MIME) type.:
Return value
void
File
- ./
smtp.phpmailer.inc, line 1764 - The mail handler class in smtp module, based on code of the phpmailer library, customized and relicensed to GPLv2.
Class
- PHPMailer
- PHPMailer - PHP email transport class NOTE: Requires PHP version 5 or later @package PHPMailer @author Andy Prevost @author Marcus Bointon @copyright 2004 - 2009 Andy Prevost
Code
public function AddStringAttachment($string, $filename, $encoding = 'base64', $type = 'application/octet-stream') {
// Append to $attachment array
$this->attachment[] = array(
0 => $string,
1 => $filename,
2 => basename($filename),
3 => $encoding,
4 => $type,
5 => TRUE,
// isStringAttachment
6 => 'attachment',
7 => 0,
);
}