--- messaging_phpmailer.module	2010-09-07 17:13:06.000000000 +1200
+++ messaging_phpmailer_new.module	2010-09-07 17:12:45.000000000 +1200
@@ -55,6 +55,11 @@ function messaging_phpmailer_settings_fo
     '#type' => 'textfield',
     '#default_value' => variable_get('messaging_phpmailer_smtp_server', ini_get('SMTP')),
   );
+  $form['messaging_phpmailer_smtp_port'] = array(
+    '#title' => t('SMTP port'),
+    '#type' => 'textfield',
+    '#default_value' => variable_get('messaging_phpmailer_smtp_port', 25),
+  );
   $form['messaging_phpmailer_auth'] = array(
     '#type'        => 'fieldset',
     '#title'       => t('SMTP Authentication'),
@@ -168,8 +173,10 @@ function messaging_phpmailer_drupal_mail
   }
   
   $host = variable_get('messaging_phpmailer_smtp_server', ini_get('SMTP'));
+  $port = variable_get('messaging_phpmailer_smtp_port', 25);
   if ($host) {
     $mail->Host = $host; // SMTP server
+    $mail->Port = $port;
   }
   else {
     watchdog('messaging', 'SMTP server cannot be reached.', array(), WATCHDOG_ERROR);
