Asked  1 Year ago    Answers:  5   Viewed   11 times

I'm trying to get php mailer to work. I'm getting an error but couldn't find any info from google on it.

$mail = new phpmailer;

$mail->IsSMTP(); // set mailer to use SMTP
$mail->SMTPSecure = "ssl";
$mail->Host = "";
$mail->Port = 465;

$mail->From = "";
$mail->FromName = "Mailer";
$mail->AddAddress("", "User");
//$mail->AddAddress("");   // name is optional
$mail->AddReplyTo("", "Information");
$mail->WordWrap = 50;    // set word wrap
//$mail->AddAttachment("c:\temp\js-bak.sql");  // add attachments

$mail->IsHTML(true);    // set email format to HTML
$mail->Subject = "Here is the subject";
$mail->Body = "This is the message body";
$mail->Send(); // send message

The code above is what I'm using but when I try to run it I get the following in my browser...

Fatal error: Cannot access empty property in /the/full/path/to/ on line 271

Here is the line it's referring to...

$header[] = sprintf("Content-Transfer-Encoding: %sn", $this->$Encoding);

If anyone can help it would be greatly appreciated! Thanks.



Encoding is not a variable: $this->Encoding

Saturday, May 29, 2021

FIXED ISSUE FOR ME I fixed this issue in my windows php environment by downloading an updated root certificates file and pointing my php.ini file to it. It seems the problem was not with gmail's cert but rather with an outdated root certificate file due to windows server 2012 no longer updating this file automatically. Download cacert.pem from here: Then in php.ini use following line to point to it (assuming you have openssl.dll installed).

openssl.cafile={Path to the file on your server}cacert.pem.

That fixed it and I no longer needed to bypass SSL/TLS verification like suggested. Ultimately I need to get windows to update root certs automatically using GPO or WSUS. see

Thursday, April 1, 2021

First thing notice off-hand: Gmail uses TLS. Don't know if having SSL instead of TLS will make much of a difference but SSL is the predecessor to TLS.

I recommend checking out also, its phpmailer customized for using gmail. PHPGMailer

Thursday, April 1, 2021

Namespace is important in soap response. Try below code:

$xml = '<?xml version = "1.0" encoding = "utf-8"?>
<soap:Envelope xmlns:soap="">
        <GetListItemsResponse xmlns="">
                        <z:row ows_MetaInfo='128;#'/>

$xml_element = simplexml_load_string($xml);
$name_spaces = $xml_element->getNamespaces(true);
$soap = $xml_element->children($name_spaces['soap'])

echo (string) $soap;
Thursday, April 1, 2021

If you Googled "CodeIgniter PHP 5.3" you would have found this article pretty quickly :)

To fix this, you only need to edit the main index.php for your CodeIgniter application:

if( ! ini_get('date.timezone') )

This modification is something you will probably need to make for any CodeIgniter application running on PHP 5.3 and can easily be modified to your local timezone. There is a full list of supported timezones in the PHP manual here.

Sunday, August 1, 2021
Only authorized users can answer the question. Please sign in first, or register a free account.
Not the answer you're looking for? Browse other questions tagged :