The following warnings occurred:
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.2.25 (Linux)
File Line Function
/global.php(961) : eval()'d code 26 errorHandler->error
/global.php 961 eval
/showthread.php 28 require_once





× This forum is read only. As of July 23, 2019, the UserSpice forums have been closed. To receive support, please join our Discord by clicking here. Thank you!

  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
phpmailer problem
#1
1. I have been using the 'Test your email settings' option on v4.3.4 using a gmail account to send to another gmail account using a Siteground host.

When the 'use isSMPT' option is set to Yes, and email debugging has a value of 2, the email message is not sent and an SMPT error is shown on the browser display.

When the 'use isSMPT' option is set to No, the email message is successfully sent and received, and no debugging message is shown on the browser window. However, if view the site by ftp, a php_mail.log file is produced (about 456 bytes in size). For every email message successfully sent the php_mail.log continues to increase in size.

I have checked the https://github.com/PHPMailer/PHPMailer/w...leshooting site 'SMTP Error: Could not connect to SMTP host.' where they suggest - This is often reported as a PHPMailer problem, but it's almost always down to local DNS failure, firewall blocking (for example as GoDaddy does) or another issue on your local network. Not particularly helpful when the email message is successfully sent and received without an error showing on the browser window, but a php_mail.log file is steadily increasing in size.

I can suppress this error using error_reporting(E_ALL ^E_WARNING);
or I could delete the php_mail.log file automatically each time an email is successfully sent using the PHP unlink() function.

I am not sure if these are sensible solutions. I would rather fix a fault rather than suppress/delete the error message.

Does anyone else have this problem, and has anyone come up with a fix?



2. I also noticed that the 4.3.4 version of Userspice has two phpmailer installations, one in the classes folder called by class.autoloader in init.php and a second called by vendor/autoload.php in helpers.php

Can the phpmailer folder in classes be deleted without causing any problems?


Thanks
  Reply
#2
I really do think that deleting the log file is a sensible option in this case. Maybe delete it if it's over a certain size? We could look at that for userspice as a whole?

Essentially there has been a war on SPAM for the last 15 years and our inboxes are a lot better off for it, but sending simple system notifications have become a lot more complicated.

I'm thinking the class.autoloader one was an oversight in building 4.3.x and most likely will not be needed but I can't confirm that. I'm guessing it's the same with the old phpmailer folder, but I haven't tried deleting that either. I may try renaming it on my production software and see what happens.
  Reply
#3
Yes SPAM is a problem I could well do without. Google are making it more difficult to use free Gmail accounts.

They can disable your Gmail account for 24 hours if they detect unusual usage. As little as 100 messages in any 24 hours period could cause your account to be disabled for the next 24 hours.

I find it amusing to 'Google the problem' for fixes - some suggest a settings change is needed - visit the less secure apps settings page of the 'sending Google account' and turn on 'access to less secure apps' - but I have not seen this make any difference.

Alternatives to Gmail might be Mailgun - who offer the first 10,000 messages and 100 validations free every month - has anyone had any experience with Mailgun and the setup required?


I agree, deleting the php_mail.log file is probably the easiest quick bodge - even though I would prefer to fix the problem.

I have added the following code to init.php to automatically delete a large (>5000 bytes) php_mail.log file - just after the line:

require_once $abs_us_root.$us_url_root.'users/helpers/helpers.php';

$php_mail_log_path = realpath(dirname(__FILE__)) . DIRECTORY_SEPARATOR . "php_mail.log";
if (file_exists($php_mail_log_path)){
$php_mail_log_filesize = filesize($php_mail_log_path);
if ($php_mail_log_filesize > 5000){
unlink($php_mail_log_path);
}
}

Thanks
  Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)