php error

149 views
Skip to first unread message

Franco Valente

unread,
Mar 15, 2025, 1:07:03 PMMar 15
to Easy!Appointments - Support Group
in the final stage 3 of the appointment booking i get this error. Finally the appointment is notified by email and recorded on the calendar. how do i solve the errors?


A PHP Error was encountered
Severity
Warning

Message
Cannot modify header information - headers already sent by (output started at /var/www/html/vendor/phpmailer/phpmailer/src/SMTP.php:302)

Filename
core/Common.php

Line Number
574

DeltaFoX

unread,
Mar 15, 2025, 3:51:52 PMMar 15
to Easy!Appointments - Support Group
The Problem is on linee 303 of case 'html': on SMTP.php file... call echo function 

echo gmdate('Y-m-d H:i:s') .....

before 

header($server_protocol.' '.$code.' '.$text, TRUE, $code); on file Common.php

just make return; on edebug function of SMTP.php for now in this way....

protected function edebug($str, $level = 0)
    {
      return;
.....

Best Regards

Franco Valente

unread,
Mar 15, 2025, 4:10:08 PMMar 15
to Easy!Appointments - Support Group
thanks for the reply Deltafox your suggestion works perfectly

Alex Tselegidis

unread,
Mar 18, 2025, 5:36:12 AMMar 18
to Easy!Appointments - Support Group
Hello! 

Thanks for sharing this fix. 

Getting such errors quite often indicate that there might be some warnings, e.g. with SMTP. 

Let us know if you spot any message in your logs. 







Alex Tselegidis, Easy!Appointments Creator
Need a customization? Get a free quote!



Franco Valente

unread,
Mar 18, 2025, 10:01:23 AMMar 18
to Easy!Appointments - Support Group

where can I find the log file?

Alex Tselegidis

unread,
Mar 24, 2025, 6:53:10 AMMar 24
to Easy!Appointments - Support Group
Hello! 

Check this troubleshooting guide: 



Alex Tselegidis, Easy!Appointments Creator
Need a customization? Get a free quote!



Alejandro Gidi

unread,
Apr 11, 2025, 4:39:32 PMApr 11
to Easy!Appointments - Support Group
Hello, guys, could you share your fix or the section of your file for those that are not developers.  Hopefully i can identify what to swap on mine as  I am getting the exact same issue after setting up the SMTP info.
 thanks

Alex Tselegidis

unread,
Apr 14, 2025, 6:36:12 AMApr 14
to Easy!Appointments - Support Group
Hi Alejandro, 

It is possible to enable verbose SMTP logs by changing the smtp_debug value of application/config/email.php to "4" 

That will output various errors that might happen while Easy!Appointments tries to connect to your SMTP server. 



Alex Tselegidis, Easy!Appointments Creator
Need a customization? Get a free quote!

 

Alejandro Gidi

unread,
Apr 22, 2025, 4:23:58 PMApr 22
to Easy!Appointments - Support Group
I appreciate the response Alex.

I am NOT a developer but after A/B/C testing and feeding an AI the errors, it seems it is not an SMTP error, because i do get the emails on both ends and the appointment gets scheduled.
It seems the error comes AFTER sending the emails.  Something that might be related to the Delta Fox reply.  But i dont think i can fix it.
Can i get billed for this fix or is it something you might upgrade? Please let me know.

Based on this output, the "unexpected problem" likely stems from a PHP issue related to sending HTTP headers after output has already begun.

Here's a breakdown:

  • SMTP Transactions Appear Successful: The SMTP communication with mail.smtp2go.com for sending emails to X...@me.com, x...@mexico.com, and xx...@demomexico.com all seem to complete successfully. The server returns 250 OK after the DATA command for each recipient, indicating the email was accepted for delivery.

  • PHP Warning: Headers Already Sent: The key indicator of a problem is the PHP warning:

    A PHP Error was encountered Severity Warning Message Cannot modify header information - headers already sent by (output started at /home/agendamela/domains/despacho.agendamela.online/public_html/vendor/phpmailer/phpmailer/src/SMTP.php:305) Filename core/Common.php Line Number 574

    This warning means that the PHP script tried to set or modify HTTP headers after it had already started sending output to the browser. In this case, the output seems to be the SMTP communication log itself, which PHPMailer can output for debugging purposes.

  • "Unexpected Problem" Correlation: The "La operación no se pudo completar debido a un problema inesperado" message likely coincides with this PHP warning. The application probably encountered an error while trying to perform a subsequent action (perhaps a redirect, setting a cookie, or some other HTTP-related task) after the email sending process, and the fact that the SMTP debug output was already sent interfered with this.

In summary, the issue isn't with the SMTP email sending itself, but rather a problem in the PHP application's execution flow where it's trying to manipulate HTTP headers after it has already started outputting content (the SMTP debug log). This typically happens when echo, print, or any other output function is called before header-related functions like header(), setcookie(), or session management functions.

To fix this, you would need to:

  1. Identify where the SMTP debug output is being enabled. This is likely a setting in your PHPMailer configuration.
  2. Ensure that all header manipulations in your PHP application occur before any output is sent to the browser, including any debugging output.

The "unexpected problem" message is a symptom of this incorrect order of operations in the PHP code.



Alex Tselegidis

unread,
May 2, 2025, 2:12:09 PMMay 2
to Easy!Appointments - Support Group
Hello! 

Thanks for providing all the info. 

It seems that you have SMTP related errors that would explain the problem, but are not included in your message.

The "Cannot modify..." is just a side effect of this. 

After enabling SMTP debug and the root debug in config.php check out the logs or page output for SMTP related info and post them here for further troubleshooting. 



Alex Tselegidis, Easy!Appointments Creator
Need a customization? Get a free quote!



Reply all
Reply to author
Forward
0 new messages