cakephp 3 getOriginalSubject undefined index issue fixed

I am using cakephp 3.1 for development one of my portal. While configuring email Igot undefined index getOriginalSubject in DebugkitTransport.php. I searched for some time on net for solution but I did not find any solution. This function tries to get subject from email obejct. I think this is bug in cakephp 3.1.

My solution is as follows. I opened DebugkitTransport.php file and in send function I changed following line


/fixing issue of $email->getOriginalSubject undefined index
$headers['Subject'] = $email->subject();

Above line fixed my issue and I am able to send email now. I using smtp setting for sending email. I am using following code for one of my site called http://eparinay.com


$email = new Email();
$email->transport('eparinay');
try {
$email->template('eparinay')
->emailFormat('html')
->to($email)
->bcc('purabdk@yahoo.co.in')
->from(['noreply@eparinay.com' => 'eParinay.com'])
->viewVars(array('username' => $username, 'email' => $email))
->subject('eParinay.com: New registration.')
->send();
} catch (Exception $e) {

echo 'Exception : ', $e->getMessage(), "\n";
}

 

Add a Comment

Your email address will not be published. Required fields are marked *