За последние 24 часа нас посетили 41269 программистов и 6246 роботов. Сейчас ищут 1779 программистов ...

PHP mailer: Signing Error: Could not write temp file

Тема в разделе "PHP для новичков", создана пользователем MaxLucky, 15 июн 2018.

  1. MaxLucky

    MaxLucky Новичок

    С нами с:
    15 июн 2018
    Сообщения:
    1
    Симпатии:
    0
    Здравствуйте, использую скрипт PHP mailer 5.2.26. Ниже привожу код. Суть в функции "$mail->sign" при добавлении выходит ошибка "Signing Error: Could not write temp file".

    Предполагаю, что не хватает прав на какую-то папку, но на какую не могу понять. Права для пользователя активированы. В чём может быть проблема?
    PHP:
    1. <?php
    2. /**
    3. * Simple example script using PHPMailer with exceptions enabled
    4. * @package phpmailer
    5. * @version $Id$
    6. */
    7. date_default_timezone_set("Europe/Moscow"); // временная зона
    8. require 'class.phpmailer.php';
    9.  
    10.  
    11.  
    12. try {
    13.     $mail = new PHPMailer(true); //New instance, with exceptions enabled
    14.  
    15.     $body             = file_get_contents('contents.html');
    16.  
    17.     $mail->IsSendmail();  // tell the class to use Sendmail
    18.  
    19.  
    20.     $mail->AddReplyTo("[EMAIL]news@obzorsoft.ru[/EMAIL]","First Last");
    21.  
    22.     $mail->CharSet = "UTF-8";
    23.     $mail->From       = "[EMAIL]news@domain.ru[/EMAIL]";
    24.     $mail->FromName   = "RB";
    25.  
    26.     $mail->sign(
    27.     'exim.crt', //The location of your certificate file
    28.     'exim.key', //The location of your private key file
    29.     //The password you protected your private key with (not the Import Password!
    30.     //May be empty but the parameter must not be omitted!
    31.     '',
    32.     '' //The location of your chain file
    33. );
    34.  
    35.     $to = "[EMAIL]mail@list.ru[/EMAIL]";
    36.  
    37.     $mail->AddAddress($to);
    38.  
    39.     $mail->Subject  = "First PHPMailer Message";
    40.  
    41.     $mail->AltBody    = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test
    42.     $mail->WordWrap   = 80; // set word wrap
    43.  
    44.     $mail->MsgHTML($body);
    45.  
    46.     $mail->IsHTML(true); // send as HTML
    47.  
    48.     $mail->Send();
    49.     echo 'Message has been sent.';
    50. } catch (phpmailerException $e) {
    51.     echo $e->errorMessage();
    52. }
    53. ?>
     
    #1 MaxLucky, 15 июн 2018
    Последнее редактирование модератором: 16 июн 2018