diff --git a/class.phpmailer.php b/class.phpmailer.php
index <HASH>..<HASH> 100644
--- a/class.phpmailer.php
+++ b/class.phpmailer.php
@@ -683,8 +683,12 @@ class PHPMailer
      */
     public function isSendmail()
     {
-        if (!stristr(ini_get('sendmail_path'), 'sendmail')) {
+        $ini_sendmail_path = ini_get('sendmail_path');
+        
+        if (!stristr($ini_sendmail_path, 'sendmail')) {
             $this->Sendmail = '/usr/sbin/sendmail';
+        } else {
+            $this->Sendmail = $ini_sendmail_path;
         }
         $this->Mailer = 'sendmail';
     }
@@ -695,8 +699,12 @@ class PHPMailer
      */
     public function isQmail()
     {
-        if (!stristr(ini_get('sendmail_path'), 'qmail')) {
+        $ini_sendmail_path = ini_get('sendmail_path');
+        
+        if (!stristr($ini_sendmail_path, 'qmail')) {
             $this->Sendmail = '/var/qmail/bin/qmail-inject';
+        } else {
+            $this->Sendmail = $ini_sendmail_path;
         }
         $this->Mailer = 'qmail';
     }
Added custom path support for sendmail and qmail