Welcome Guest, Not a member yet? Register   Sign In
Pec email
#1

HI , sorry for english i try to send pec from my webapp with codeigniter 3 :

PHP Code:
$this->load->library('email');

    $config['protocol'] = 'smtp';
    $config['mailPath'] = '/usr/sbin/sendmail';
    $config['charset']  'iso-8859-1';
    $config['wordWrap'] = true;
    
    $config
['smtp_crypto'] = 'ssl';
    $config['mailtype'] = 'html';
    $config['SMTPHost'] = 'smtps.pec.aruba.it';
    $config['SMTPUser'] = '[email protected]';
    $config['SMTPPass'] = 'xxxxxxxx';
    $config['SMTPPort'] = 465;

    $this->email->initialize($config);

    $this->email->from('[email protected]''[email protected]');

    $this->email->to('[email protected]');



      $this->email->subject('Prove Pec Stefano ' );

      $message '
      <html>
      <head>
          <title></title>
      </head>
      <body>
          <p>Prova composizione pec <p>


      </body>
      </html>'
;

      $this->email->message($message);

      if ($this->email->send()) {

          echo 'Inviata';
          //return TRUE;

      }else{

          //return $email->printDebugger();
          echo  $this->email->print_debugger();
      


This is the error : 
Code:
You did not specify a SMTP hostname.
Unable to send email using PHP SMTP. Your server might not be configured to send mail using this method.

Wath can i do ?
Reply
#2

Is this wrong?
PHP Code:
$config['SMTPHost'] = 'smtps.pec.aruba.it';

// should it be
$config['SMTPHost'] = 'smtp.pec.aruba.it'
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#3

(06-09-2021, 08:58 PM)InsiteFX Wrote: Is this wrong?
PHP Code:
$config['SMTPHost'] = 'smtps.pec.aruba.it';

// should it be
$config['SMTPHost'] = 'smtp.pec.aruba.it'

It s the config parametri get by site
Reply
#4

Ok, I see what it is now, I do not think that CodeIgniter can handle that.
I did find this library that you should be able to use.
PHP PEC Email Library
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply




Theme © iAndrew 2016 - Forum software by © MyBB