Index: messaging_phpmailer.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/messaging/messaging_phpmailer/Attic/messaging_phpmailer.module,v
retrieving revision 1.1.2.10.2.13.2.5.4.10
diff -u -r1.1.2.10.2.13.2.5.4.10 messaging_phpmailer.module
--- messaging_phpmailer.module	24 May 2010 14:06:31 -0000	1.1.2.10.2.13.2.5.4.10
+++ messaging_phpmailer.module	4 Jun 2010 01:36:15 -0000
@@ -71,6 +71,19 @@
     '#default_value' => variable_get('messaging_phpmailer_smtp_password', ''),
     '#description'   => t('SMTP password.'),
   );
+  $form['messaging_phpmailer_auth']['messaging_phpmailer_smtp_secure'] = array(
+    '#type'          => 'radios',
+    '#title'         => t('SMTP Security'),
+    '#options'       => array('' => t('None'), 'tls' => t('TLS'), 'ssl' => t('SSL')),
+    '#default_value' => variable_get('messaging_phpmailer_smtp_secure', ''),
+    '#description'   => t('What security, if any, to use for this SMTP connection.'),
+  );
+  $form['messaging_phpmailer_auth']['messaging_phpmailer_smtp_port'] = array(
+    '#type'          => 'textfield',
+    '#title'         => t('SMTP Port'),
+    '#default_value' => variable_get('messaging_phpmailer_smtp_port', 25),
+    '#description'   => t('What port to use for the connection.'),
+  );
   $form['messaging_phpmailer_attach'] = array(
       '#title' => t('Include attachments'),
       '#type' => 'checkbox',
@@ -160,8 +173,12 @@
   $mail->IsSMTP(); // telling the class to use SMTP
   $mail->CharSet = 'utf-8';
   $mail->ContentType = 'text/html';
+  if (variable_get('messaging_phpmailer_smtp_secure', '') != '') {
+    $mail->SMTPSecure = variable_get('messaging_phpmailer_smtp_secure', '');
+  }
+  $mail->Port = variable_get('messaging_phpmailer_smtp_port', 25);
   
-    // Set the authentication settings.
+  // Set the authentication settings.
   $username = variable_get('messaging_phpmailer_smtp_username', '');
   $password = variable_get('messaging_phpmailer_smtp_password', '');
 
@@ -243,7 +260,11 @@
     watchdog('messaging', 'PHPMailer debug message: '. $mail->Send() . ' - ' . $mail->ErrorInfo);    
   }
   else {
-    return $mail->Send();
+    $result = $mail->Send();
+    if (!$result) {
+      watchdog('messaging', 'PHPMailer exception: !details', array('!details' => $mail->ErrorInfo), WATCHDOG_ERROR);
+    }
+    return $result;
   }
 }
 
