News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

fsockopen

Started by George, August 25, 2004, 03:28:52 AM

Previous topic - Next topic

George

My server does not allow fsockopen(). It gives me an error message

Warning: fsockopen() has been disabled for security reasons in /var/www/domains/x.matrixbay.com/docs/mambo/administrator/components/com_phpshop/classes/phpmailer/class.smtp.php on line 105
SMTP Error: Could not connect to SMTP host.

Is there any way i can solve this problem.

Soeren

Hello,

the relevant code is contained in the file classes/ps_checkout.php, function email_receipt().

Change

        /*** telling the mailer objects to use SMTP ***/
        $shopper_mail->IsSMTP();
        $vendor_mail->IsSMTP();
       
        /*** turn debugging messages off  ***/
        $shopper_mail->SMTPDebug = false;
        $vendor_mail->SMTPDebug = false;
       
        $shopper_mail->Host = CFG_SMTPHOST;
        $vendor_mail->Host = CFG_SMTPHOST;
       
        $shopper_mail->SMTPAuth = CFG_SMTPAUTH=='1' ? true : false;
        $vendor_mail->SMTPAuth = CFG_SMTPAUTH=='1' ? true : false;
       
        if (CFG_SMTPAUTH=='1') {
            $shopper_mail->Username = CFG_SMTPUSER;
            $vendor_mail->Username = CFG_SMTPUSER;
            $shopper_mail->Password = CFG_SMTPPASS;
            $vendor_mail->Password = CFG_SMTPPASS;    
        }
       
        if (!$shopper_mail->Send() || !$vendor_mail->Send())
          echo $shopper_mail->ErrorInfo;
          echo $vendor_mail->ErrorInfo;
          return false;


to
   // using the php mail() function
    $mosConfig_mailer = \"mail\";
   // $mosConfig_mailer = \"smtp\";
   if ($mosConfig_mailer==\"smtp\" ) {

        /*** telling the mailer objects to use SMTP ***/
        $shopper_mail->IsSMTP();
        $vendor_mail->IsSMTP();
       
        /*** turn debugging messages off  ***/
        $shopper_mail->SMTPDebug = false;
        $vendor_mail->SMTPDebug = false;
       
        $shopper_mail->Host = CFG_SMTPHOST;
        $vendor_mail->Host = CFG_SMTPHOST;
       
        $shopper_mail->SMTPAuth = CFG_SMTPAUTH=='1' ? true : false;
        $vendor_mail->SMTPAuth = CFG_SMTPAUTH=='1' ? true : false;
       
        if (CFG_SMTPAUTH=='1') {
            $shopper_mail->Username = CFG_SMTPUSER;
            $vendor_mail->Username = CFG_SMTPUSER;
            $shopper_mail->Password = CFG_SMTPPASS;
            $vendor_mail->Password = CFG_SMTPPASS;    
        }
      }
        if (!$shopper_mail->Send() || !$vendor_mail->Send()) {
          echo $shopper_mail->ErrorInfo;
          echo $vendor_mail->ErrorInfo;
          return false;
        }


So you're using the php function mail for better compatibility.

ciao, soeren
The future of eCommerce: VirtueMart & Joomla!
http://virtuemart.net

Jon Berry

I have tried this fix and I have tried forcing SMTP authorization, but I cannot get this to send the emails out.

Neither the order notification for teh administrator, nor the receipts are going out of the server.

I am using 1.1a.

Any help will be HUGELY apprecaited.

Jon

Guest

Quote from: Soeren on August 25, 2004, 12:16:11 PM
Hello,

the relevant code is contained in the file classes/ps_checkout.php, function email_receipt().

Change

       /*** telling the mailer objects to use SMTP ***/
       $shopper_mail->IsSMTP();
       $vendor_mail->IsSMTP();
       
       /*** turn debugging messages off  ***/
       $shopper_mail->SMTPDebug = false;
       $vendor_mail->SMTPDebug = false;
       
       $shopper_mail->Host = CFG_SMTPHOST;
       $vendor_mail->Host = CFG_SMTPHOST;
       
       $shopper_mail->SMTPAuth = CFG_SMTPAUTH=='1' ? true : false;
       $vendor_mail->SMTPAuth = CFG_SMTPAUTH=='1' ? true : false;
       
       if (CFG_SMTPAUTH=='1') {
           $shopper_mail->Username = CFG_SMTPUSER;
           $vendor_mail->Username = CFG_SMTPUSER;
           $shopper_mail->Password = CFG_SMTPPASS;
           $vendor_mail->Password = CFG_SMTPPASS;    
       }
       
       if (!$shopper_mail->Send() || !$vendor_mail->Send())
         echo $shopper_mail->ErrorInfo;
         echo $vendor_mail->ErrorInfo;
         return false;


to
   // using the php mail() function
   $mosConfig_mailer = \"mail\";
  // $mosConfig_mailer = \"smtp\";
  if ($mosConfig_mailer==\"smtp\" ) {

       /*** telling the mailer objects to use SMTP ***/
       $shopper_mail->IsSMTP();
       $vendor_mail->IsSMTP();
       
       /*** turn debugging messages off  ***/
       $shopper_mail->SMTPDebug = false;
       $vendor_mail->SMTPDebug = false;
       
       $shopper_mail->Host = CFG_SMTPHOST;
       $vendor_mail->Host = CFG_SMTPHOST;
       
       $shopper_mail->SMTPAuth = CFG_SMTPAUTH=='1' ? true : false;
       $vendor_mail->SMTPAuth = CFG_SMTPAUTH=='1' ? true : false;
       
       if (CFG_SMTPAUTH=='1') {
           $shopper_mail->Username = CFG_SMTPUSER;
           $vendor_mail->Username = CFG_SMTPUSER;
           $shopper_mail->Password = CFG_SMTPPASS;
           $vendor_mail->Password = CFG_SMTPPASS;    
       }
     }
       if (!$shopper_mail->Send() || !$vendor_mail->Send()) {
         echo $shopper_mail->ErrorInfo;
         echo $vendor_mail->ErrorInfo;
         return false;
       }


So you're using the php function mail for better compatibility.

ciao, soeren

Hi i did these changes but all it does is take my site footer away and give me a blank screen with Chart when i get to the Chart of mine...
I am sooo Smart