? phpmailer
Index: smtp.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/smtp/smtp.module,v
retrieving revision 1.17.2.21
diff -u -p -r1.17.2.21 smtp.module
--- smtp.module	4 Aug 2010 17:52:04 -0000	1.17.2.21
+++ smtp.module	8 Nov 2010 11:08:45 -0000
@@ -235,9 +235,14 @@ function smtp_admin_settings_validate($f
   if ($form_state['values']['smtp_from'] && !valid_email_address($form_state['values']['smtp_from'])) {
     form_set_error('smtp_from', t('The provided from e-mail address is not valid.'));
   }
+  // If username is set empty, we must set both username/password empty as
+  // as well.
+  if (empty($form_state['values']['smtp_username'])) {
+    $form_state['values']['smtp_password'] = '';
+  }
   // A little hack. When form is presentend, the password is not shown (Drupal way of doing).
-  // So, if user submits the form without changing the password, we mus prevent it from being reset.
-  if (empty($form_state['values']['smtp_password'])) {
+  // So, if user submits the form without changing the password, we must prevent it from being reset.
+  elseif (empty($form_state['values']['smtp_password'])) {
     unset($form_state['values']['smtp_password']);
   }
 }  //  End of smtp_admin_settings_validate().
