PHP Classes

Class doesn't work for me

Recommend this page to a friend!

      PHP Mail Class  >  All threads  >  Class doesn't work for me  >  (Un) Subscribe thread alerts  
Subject:Class doesn't work for me
Summary:Fatal error on line 204
Messages:2
Author:karl kir
Date:2019-04-02 15:55:38
 

  1. Class doesn't work for me   Reply   Report abuse  
Picture of karl kir karl kir - 2019-04-02 15:55:38
Hi,

I try you class and when i try to send a smtp mail with i receive this error :

Fatal error: Default value for parameters with a class type hint can only be NULL in /public_html/class/Mail.class.php on line 204


//Example using smtp
$mail = new Mail;

//Set subject and sender of the mail.
$mail->setSubject('Example mail');
$mail->setSender('test@domain.com');
//Set the plain content of the mail.
$mail->setContentPlain('Example plain-content!');
//Add a receiver of the mail (you can add more than one receiver too).
$mail->addReceiver('test1@domain.com');

$mail->isSMTP(true,array('host'=>"mail.domain.ca",
'user'=>'user@domain.com',
'pass'=>'pwd',
'port'=>465));
//Finally send the mail.
var_dump($mail->send());

Do you have any solution for me?

Thanks


  2. Re: Class doesn't work for me   Reply   Report abuse  
Picture of Muhammad Umer Farooq Muhammad Umer Farooq - 2019-04-03 02:18:51 - In reply to message 1 from karl kir
Which version of php you were used?