Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Emailing module throws error in PHP8.2 but not in PHP7.4 #31741

Closed
hasse-basse opened this issue Nov 8, 2024 · 4 comments
Closed

Emailing module throws error in PHP8.2 but not in PHP7.4 #31741

hasse-basse opened this issue Nov 8, 2024 · 4 comments
Labels
Bug This is a bug (something does not work as expected)

Comments

@hasse-basse
Copy link

Bug

When trying to set up a massmailing and trying to send a Test mail I fail with an error when using PHP8.2, but all is fine with PHP7.4. I use Password and Swift Mailer socket library (smtp.office365.com)

AH01071: Got error 'PHP message: PHP Fatal error: Uncaught TypeError: preg_split(): Argument #2 ($subject) must be of type string, array given in /htdocs/includes/swiftmailer/lib/classes/Swift/Mime/Headers/AbstractHeader.php:312\nStack trace:\n#0 /htdocs/includes/swiftmailer/lib/classes/Swift/Mime/Headers/AbstractHeader.php(312): preg_split()\n#1 /htdocs/includes/swiftmailer/lib/classes/Swift/Mime/Headers/AbstractHeader.php(259): Swift_Mime_Headers_AbstractHeader->getEncodableWordTokens()\n#2 /htdocs/includes/swiftmailer/lib/classes/Swift/Mime/Headers/UnstructuredHeader.php(103): Swift_Mime_Headers_AbstractHeader->encodeWords()\n#3 /htdocs/includes/swiftmailer/lib/classes/Swift/Mime/SimpleHeaderSet.php(309): Swift_Mime_Headers_UnstructuredHeader->getFieldBody()\n#4 /htdocs/...', referer: https://WWW.XXX/XXX/htdocs/comm/mailing/card.php?action=test&token=c9911ad4d077eabb07f5597a92641508&id=15

Dolibarr Version

19.0.3

Environment PHP

PHP 8.2.15

Environment Database

Maria

Steps to reproduce the behavior and expected behavior

No response

Attached files

No response

@hasse-basse hasse-basse added the Bug This is a bug (something does not work as expected) label Nov 8, 2024
@marc-dll
Copy link
Contributor

Hello,

I cannot reproduce with the latest Dolibarr (19.0.4 from Github), can you test with the latest code please ?

Greetings.

@hasse-basse
Copy link
Author

Still same problem and now I'm on 19.0.4. To be sure we talk about the same thing, pls see the below image of where in Dolibarr I am.
Capture d’écran 2024-11-14 232348

@marc-dll
Copy link
Contributor

Thank you for your quick reply, I reproduced by setting the field "Errors to/Erreurs à" field that was not set in my first test. I'll work on a fix

@hasse-basse
Copy link
Author

Great !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug This is a bug (something does not work as expected)
Projects
None yet
Development

No branches or pull requests

2 participants