diff --git smtp.module smtp.module index 8c52a68..6d651dc 100644 --- smtp.module +++ smtp.module @@ -300,10 +300,10 @@ function drupal_mail_wrapper($message) { } } */ - if (preg_match('/^".*"\s*<.*>$/', $from)) { + if (preg_match('/^"?.*"?\s*<.*>$/', $from)) { // . == Matches any single character except line break characters \r and \n. // * == Repeats the previous item zero or more times. - $from_name = preg_replace('/"(.*)"(.*)/i', '$1', $from); // It gives: Name + $from_name = preg_replace('/"?(.*)"?\s<(.*)>/i', '$1', $from); // It gives: Name $from = preg_replace("/(.*)\<(.*)\>/i", '$2', $from); // It gives: name@domain.tld } elseif (!valid_email_address($from)) {