Re: Emailing not setting mime-type

On all three client sites the above SMTP Mailer setup is working.

On one site I get the following error:

Creation of dynamic property email::$phpmailerCharSet is deprecated in file: /home/mysite/public_html/accounts/reporting/includes/class.mail.inc at line 131

I have tried to redo the installation with still the same error. It is sending the email even with the error. Do not know why this is the only site with this error.

Wynand

Re: Emailing not setting mime-type

Check this out for differential encoding issues and potential use of utf8_encode(). Also check if $mail->CharSet = "UTF-8"; works.

Re: Emailing not setting mime-type

On one of the installations of FA 2.4.17 get an age-old error. Do not know why on all the other FA installations I did not get this error: Sending document by email failed.

I have redone the PHPMail installation and replacement of all the files as per instruction but the error remains. The email address is correct and the SMTP mail sending setup is correct.

I have even deleted the mail account on the server and redo the setup, still have the same error.

Got this post for the same errors https://frontaccounting.com/punbb/viewtopic.php?id=6369

I am stuck again.

Wynand

Re: Emailing not setting mime-type

seahawk wrote:

On all three client sites the above SMTP Mailer setup is working.

On one site I get the following error:

Creation of dynamic property email::$phpmailerCharSet is deprecated in file: /home/mysite/public_html/accounts/reporting/includes/class.mail.inc at line 131

I have tried to redo the installation with still the same error. It is sending the email even with the error. Do not know why this is the only site with this error.

The Class.mail.inc at line 131 - 142 has the following code as downloaded for use with SMTP PHPMailer:

    public function send() {
        $this->phpmailerCharSet = $this->charset;

        //send the message, check for errors
        if (!$this->phpmailer->send()) {
            error_log('Mailer error:' . $this->phpmailer->ErrorInfo);
            //echo "Mailer Error: " . $this->phpmailer->ErrorInfo;
            return 0;
        } else {
            return 1;
        }
    }
}

-----------------
It is the same code on other installations and none of them has this particular problem.

Wynand

Re: Emailing not setting mime-type

The strange this is despite the error, it is still sending the email as well as the Bcc emails via the smtp.

Wynand

Re: Emailing not setting mime-type

seahawk wrote:

On all three client sites the above SMTP Mailer setup is working.

On one site I get the following error:

Creation of dynamic property email::$phpmailerCharSet is deprecated in file: /home/mysite/public_html/accounts/reporting/includes/class.mail.inc at line 131

I have tried to redo the installation with still the same error. It is sending the email even with the error. Do not know why this is the only site with this error.

This is related to php version installed, and can be easily fixed by adding declaration of property phpmailerCharSet in email class declaration.

FYI, just released FA v 2.4.18 contains a couple of bugfixes to mailer class included in FA .
J.

32 (edited by seahawk 04/14/2024 01:28:10 pm)

Re: Emailing not setting mime-type

@trafficpest I am getting the following error on only one site with the same setup as three other sites with the SMTP class.mail replacement file:

TAX INVOICE IN003/2024. Sending document by email failed. Email: (it is a working email address, and the SMTP setup was checked and rechecked, but no luck in sending the invoice.)

Not sure which other file might have an impact on the sending.

I have updated FA to 2.4.18.

It is a simular issue that happened in 2013 and 2016 by searching the phrase "Sending document by email called."

Wynand

33 (edited by trafficpest 04/15/2024 09:39:19 pm)

Re: Emailing not setting mime-type

OK, I checked it out for you. (mind you this is not my plugin. So Im just looking through code.)

Looks like there is a typo in class.mail.inc line 131 must be some versions of php will allow defining outside of the class while others do not. (like your 3rd server) I works on mine running PHP 8.0.30

the line should read

$this->phpmailer->CharSet = $this->charset;

Im guessing that should fix it. Let me know

Re: Emailing not setting mime-type

I tested it and it works in my install (though it worked for me prior to the fix)
I have created a mail branch in my extensions repo again with the fix.


https://github.com/trafficpest/FA24ex … tree/mail


@apmuthu I didn't forget to hash the files for init this time if you want to pull such a trivial fix. lol

Re: Emailing not setting mime-type

trafficpest wrote:

I tested it and it works in my install (though it worked for me prior to the fix)
I have created a mail branch in my extensions repo again with the fix.


https://github.com/trafficpest/FA24ex … tree/mail


@apmuthu I didn't forget to hash the files for init this time if you want to pull such a trivial fix. lol


Cannot download the file.

The line 131 error on PHP 8.2 has now gone away but it has two new errors:


Undefined array key 1 in file: /home/mysite/public_html/accounts/reporting/includes/class.mail.inc at line 88

trim(): Passing null to parameter #1 ($string) of type string is deprecated in file: /home/mysite/public_html/accounts/modules/mail/includes/PHPMailer/class.phpmailer.php at line 873

Seems to be quite a challenge.

Wynand

Re: Emailing not setting mime-type

seahawk wrote:

@trafficpest I am getting the following error on only one site with the same setup as three other sites with the SMTP class.mail replacement file:

TAX INVOICE IN003/2024. Sending document by email failed. Email: (it is a working email address, and the SMTP setup was checked and rechecked, but no luck in sending the invoice.)

Not sure which other file might have an impact on the sending.

I have updated FA to 2.4.18.

It is a simular issue that happened in 2013 and 2016 by searching the phrase "Sending document by email called."


This issue on another installation is still there despite the updates.

Wynand

Re: Emailing not setting mime-type

seahawk wrote:
trafficpest wrote:

I tested it and it works in my install (though it worked for me prior to the fix)
I have created a mail branch in my extensions repo again with the fix.


https://github.com/trafficpest/FA24ex … tree/mail


@apmuthu I didn't forget to hash the files for init this time if you want to pull such a trivial fix. lol


Cannot download the file.

The line 131 error on PHP 8.2 has now gone away but it has two new errors:


Undefined array key 1 in file: /home/mysite/public_html/accounts/reporting/includes/class.mail.inc at line 88

trim(): Passing null to parameter #1 ($string) of type string is deprecated in file: /home/mysite/public_html/accounts/modules/mail/includes/PHPMailer/class.phpmailer.php at line 873

Seems to be quite a challenge.


After I updated the following bugs reported in this feed, https://frontaccounting.com/punbb/viewtopic.php?id=10451
the errors disappeared.

Wynand

Re: Emailing not setting mime-type

Was there any final decision about the mail() versus PHPmailer for the future?

Wynand

Re: Emailing not setting mime-type

I think mail should be the way to go normally but sometimes servers don't have their mail server setup, have deliverability issues, or people just want to send email from a Google account or something will use phpmailer.