You are here

function PHPMailer::AddStringAttachment in SMTP Authentication Support 5

Same name and namespace in other branches
  1. 7.2 smtp.phpmailer.inc \PHPMailer::AddStringAttachment()
  2. 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.module, line 1721
Enables drupal to send email directly to an SMTP server using authentication. Uses the PHPMailer class by Brent R. Matzelle.

Class

PHPMailer
PHPMailer - PHP email transport class @package PHPMailer @author Brent R. Matzelle @copyright 2001 - 2003 Brent R. Matzelle

Code

function AddStringAttachment($string, $filename, $encoding = "base64", $type = "application/octet-stream") {

  // Append to $attachment array
  $cur = count($this->attachment);
  $this->attachment[$cur][0] = $string;
  $this->attachment[$cur][1] = $filename;
  $this->attachment[$cur][2] = $filename;
  $this->attachment[$cur][3] = $encoding;
  $this->attachment[$cur][4] = $type;
  $this->attachment[$cur][5] = true;

  // isString
  $this->attachment[$cur][6] = "attachment";
  $this->attachment[$cur][7] = 0;
}