You are here

function phpmailer_mailengine in PHPMailer 7.4

Same name and namespace in other branches
  1. 8.3 phpmailer.module \phpmailer_mailengine()
  2. 5.2 phpmailer.module \phpmailer_mailengine()
  3. 5 phpmailer.module \phpmailer_mailengine()
  4. 6.3 phpmailer.module \phpmailer_mailengine()
  5. 6 phpmailer.module \phpmailer_mailengine()
  6. 6.2 phpmailer.module \phpmailer_mailengine()
  7. 7.3 phpmailer.module \phpmailer_mailengine()

Implements hook_mailengine().

File

./phpmailer.module, line 76
Integrates the PHPMailer library for SMTP e-mail delivery.

Code

function phpmailer_mailengine($op, $message = array()) {
  if (!phpmailer_library_exists()) {
    return;
  }
  switch ($op) {
    case 'list':
      return array(
        'name' => t('PHPMailer'),
        'description' => t('Mailing engine using the PHPMailer library.'),
      );
    case 'settings':
      $form['info']['#markup'] = t('To configure your mail server settings, visit the <a href="@url">PHPMailer settings page</a>.', array(
        '@url' => url('admin/config/system/phpmailer'),
      ));
      return $form;
    case 'multiple':
    case 'single':
    case 'send':
      module_load_include('inc', 'phpmailer', 'includes/phpmailer.mimemail');

      // Mimemail API does not load mimemail.inc for other mailengines; we rely
      // on mimemail_rfc_headers(), so ensure that it is loaded.
      module_load_include('inc', 'mimemail');
      return mimemail_phpmailer_send($message);
  }
}