You are here

public function mime_mail::send in Backup and Migrate 7.3

Same name and namespace in other branches
  1. 8.2 includes/destinations.email.inc \mime_mail::send()
  2. 8.3 includes/destinations.email.inc \mime_mail::send()
  3. 6.3 includes/destinations.email.inc \mime_mail::send()
  4. 6.2 includes/destinations.email.inc \mime_mail::send()
  5. 7.2 includes/destinations.email.inc \mime_mail::send()

File

includes/destinations.email.inc, line 160
Functions to handle the email backup destination.

Class

mime_mail

Code

public function send() {
  $headers = array();
  if (!empty($this->body)) {
    $this
      ->add_attachment($this->body, "", "text/plain");
  }
  $headers['MIME-Version'] = "1.0";
  $boundary = "b" . md5(uniqid(time()));
  $headers['Content-Type'] = "multipart/mixed; boundary=\"{$boundary}\"";
  $message = $this
    ->build_multipart($boundary);
  $params = array();
  $params['body'] = $message;
  $params['headers'] = $headers;
  $params['subject'] = $this->subject;
  drupal_mail('backup_migrate', 'destination_mail', trim($this->to), '', $params, $this->from);
}