Replies: 5 comments 11 replies
-
Um, did you not read the readme or any of the examples that show how to import PHPMailer classes into the global namespace? Add either a |
Beta Was this translation helpful? Give feedback.
0 replies
-
Marcus, Yes. I am a big fan of PHP Mailer and I have been using PHPMailer
for longer than I can remember. I also succesffull took it through the
namespace upgrade. What really inspired me to make this general post was
that for some reason the code that has been working breaks at that very
basic initial step and things like the known GoDaddy issue prompted me to
take a shot in the dark. I was hoping someone would come back and say, "Ah,
yes, Michael, Dreamhost did X and you just need to do Y. Problem solved!"
or "Ah, yes, in PHP 8, this weird little bit that they got picky about may
cause that."
Because the page fails at that very first step, I can't even get to the
point where it will see my DEBUG setting.
I may just have to nuke it from orbit and start from scratch.
<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
Virus-free.www.avast.com
<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
…On Wed, Nov 15, 2023 at 3:01 AM Marcus Bointon ***@***.***> wrote:
Um, did you not read the readme or any of the examples that show how to
import PHPMailer classes into the global namespace? Add either a use
statement or use a fully qualified class name. Reading the upgrade guide
might help too.
—
Reply to this email directly, view it on GitHub
<#2976 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACHDZVNTP5O7VLPI4TLS24LYESAHNAVCNFSM6AAAAAA7LX4CUWVHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM3TKNZUGQ4TC>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
--
Michael
|
Beta Was this translation helpful? Give feedback.
1 reply
-
My apologies.
I was using "echo" as a smoke test.
I slid one in before and after. The one before executed, the one after did
not.
My problem is that my testers apparently did virtually no testing. I and
they are volunteers with limited time to work on this and the mail feature
is only invoked for very specific things (account creation and
verification, password reset, and some notifications), so it's quite
understandable that it slipped by.
It's being hit heavily now so I was loath to switch on errors, but I will
try to look into that after I get off work and before my other volunteer
work starts.
Apologies for the sub-optimal context.
Michael
<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
Virus-free.www.avast.com
<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
…On Wed, Nov 15, 2023 at 9:01 AM Marcus Bointon ***@***.***> wrote:
One key problem here is that you say "it breaks", but don't say how.
Syntax error? Class not found? We can only guess without an error message.
—
Reply to this email directly, view it on GitHub
<#2976 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACHDZVM2BJBI36P2JUC7K3TYETKNXAVCNFSM6AAAAAA7LX4CUWVHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM3TKNZYGA4DC>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
--
Michael
|
Beta Was this translation helpful? Give feedback.
1 reply
-
Ok, thanks for the clarification.
I found a minute to add that and run it:
" *Fatal error*: Uncaught Error: Class "PHPMailer" not found"
<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
Virus-free.www.avast.com
<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
…On Wed, Nov 15, 2023 at 12:25 PM Marcus Bointon ***@***.***> wrote:
It shouldn't be a matter of "switching on" errors – you should find any
PHP errors in your web server's error log, or on the console if you run the
script manually. If you can add 'echo' to a script, you can temporarily
make errors very visible by adding ini_set('display_errors', 1);.
—
Reply to this email directly, view it on GitHub
<#2976 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACHDZVMKR5DKBFF663JGUC3YEUCKZAVCNFSM6AAAAAA7LX4CUWVHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM3TKOBQGEZTC>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
--
Michael
|
Beta Was this translation helpful? Give feedback.
1 reply
-
Sounds good, thank you for your help and thanks for PHP Mailer!
<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
Virus-free.www.avast.com
<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
…On Wed, Nov 15, 2023 at 2:00 PM Marcus Bointon ***@***.***> wrote:
This is what I suspected. This means one of two things: either the class
is not loaded, or you have not imported it into the namespace. Change your
line of code to this:
$mail = new \PHPMailer\PHPMailer\PHPMailer();
Then run it again. If you get the same error, it will be because the class
is not loaded, in which case you need to check that your composer setup is
working, or if you're not using that, that you have appropriate require
statements to load the classes. See the readme for more info on that.
—
Reply to this email directly, view it on GitHub
<#2976 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACHDZVP7UMEDQUICYYUYOATYEUNM5AVCNFSM6AAAAAA7LX4CUWVHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM3TKOBQHAZDQ>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
--
Michael
|
Beta Was this translation helpful? Give feedback.
8 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have had PHPMailer working beautifully on my site for many years. I upgraded to PHP 8.1 in the past 3-6 months and I honestly can't recall what version of PHP I was on. My existing PHP Mailer files are from 8/29/2023 and I think the mail functions were working. To be honest, they are only used to create accounts and reset passwords for the most part, so not as obvious a problem. I am sure they were working in February of this year, because usage was hot and heavy then.
Anyway, right now, my code (which, again, was working for years) breaks when I hit this line:
$mail = new PHPMailer;
I am not entirely sure how to debug that. Any help would be appreciated.
Is it a PHP upgrade thing? A Dreamhost change thing?
Beta Was this translation helpful? Give feedback.
All reactions