diff --git a/smtp.module b/smtp.module
index 694516f..be54a1a 100644
--- a/smtp.module
+++ b/smtp.module
@@ -338,7 +338,7 @@ function smtp_drupal_mail_wrapper($message) {
   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('/"?([^("\s)]*)"?.*$/', '$1', $from); // It gives: Name
+    $from_name = preg_replace('/("|\s*?<.*>$)/', '', $from); // It gives: Name
     $from      = preg_replace("/(.*)\<(.*)\>/i", '$2', $from); // It gives: name@domain.tld
   }
   elseif (!valid_email_address($from)) {
