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

Appearing invalid letters and characters #2941

Closed
bcs018 opened this issue Aug 9, 2023 · 21 comments
Closed

Appearing invalid letters and characters #2941

bcs018 opened this issue Aug 9, 2023 · 21 comments

Comments

@bcs018
Copy link

bcs018 commented Aug 9, 2023

Hi, I'm having a problem sending email.
Strange letters are coming out in the middle of words, like C1, A1, A3...

When analyzing, I realized that it does this after a specific amount of characters.

photo_2023-08-09_15-43-32

I already converted to utf-8 and iso-8859-1 but without success

@Synchro
Copy link
Member

Synchro commented Aug 9, 2023

What you're seeing is called quoted-printable encoding, and on the whole it should not be necessary on modern mail servers which allow 8-bit character sets in message bodies, and so don't usually need encoding. Issues can be caused by the PHP mail() function adding extra line breaks in unexpected places, and the best way to solve that is to avoid it by using SMTP to localhost instead, which you should be able to do by adding a call to $mail->isSMTP() in your script.

Beyond that I'd need to see your script and the output you get with $mail->SMTPDebug = 2;.

@bcs018
Copy link
Author

bcs018 commented Aug 11, 2023

this is the result of $mail->SMTPDebug = 2;

Log Email

this is how the sending of the email is configured

Screenshot_1

does this problem have anything to do with XAMPP or Apache configuration?

@Synchro
Copy link
Member

Synchro commented Aug 11, 2023

The key mistake I see there is setting the content transfer encoding in a custom header. PHPMailer will set that correctly for you, and by setting yourself it's likely to cause a conflict, resulting in the kind of confusion you're getting. I suggest you delete that line.

@bcs018
Copy link
Author

bcs018 commented Aug 11, 2023

sorry what line would be the transfer encoding?

@Synchro
Copy link
Member

Synchro commented Aug 12, 2023

This one specifically:

$mail->addCustomHeader('Content-Transfer-encoding: 8bit \r\n');

I also noticed that all your other custom headers have line breaks in, but they are formatted incorrectly - \r\n will not work in single-quoted strings, and you should not be adding line breaks anyway as it they will either be ignored, fail, or produce corrupt messages, so don't do that. For the purposes of the specific issue you described, I suggest you comment them all out for now, add them back when your issue is resolved.

@bcs018
Copy link
Author

bcs018 commented Aug 14, 2023

it worked with these settings, thank you very much!

I removed the line:
$mail->addCustomHeader('Content-Transfer-encoding: 8bit \r\n');

and removed all the \r\n from the header

@bcs018 bcs018 closed this as completed Aug 14, 2023
@Synchro
Copy link
Member

Synchro commented Aug 14, 2023

That's good to hear. Generally speaking, PHPMailer tries to make things easier for you - if you find yourself doing fiddly things like adding line breaks or adding transfer encodings manually, you're probably doing more work than necessary!

@bcs018 bcs018 reopened this Feb 1, 2024
@bcs018
Copy link
Author

bcs018 commented Feb 1, 2024

@Synchro I'm having the same problem again, but now the issue occurs when I attach a certificate to the email. When I remove the certificate, the problem doesn't happen. Have you seen anything similar with the certificate?

image

Another detail is that in the variable "$aviso" there is a text. If I remove half of the text, it works, but with the entire text it doesn't work correctly.

image

This is the remaining part of the code.
Notice the red square, that's where I send the certificate.

@Synchro
Copy link
Member

Synchro commented Feb 1, 2024

Why are you manually setting the encoding to 7-bit when you have 8-bit content? That's not going to work, so I suggest you delete that line and let PHPMailer set the encoding for you.

@bcs018
Copy link
Author

bcs018 commented Feb 2, 2024

I've already done that, removed the 7bits, set it to 8bits, and left it empty. The issue is that when I don't set the encoding to 7bits, it gives an error of invalid signature.
As mentioned in a previous topic here about signatures, where there was an issue with an invalid signature, the fix was to set the encoding to 7bits.

@bcs018
Copy link
Author

bcs018 commented Feb 2, 2024

Apparently the issue lies with the signature itself; when removing the signature $mail->sign(), everything works perfectly.

@Synchro
Copy link
Member

Synchro commented Feb 2, 2024

That's odd. I wonder if the signing process has trouble with UTF-8?

@bcs018
Copy link
Author

bcs018 commented Feb 2, 2024

log

@Synchro In this test I performed, the email was sent without a signature, and if you observe in the log, it contains strange characters, yet the email is received normally. However, when the signature is added, these characters are included in the email.

@Synchro
Copy link
Member

Synchro commented Feb 2, 2024

The "strange characters" are normal quoted-printable encoding, which you can see is the designated encoding in the content-transfer-encoding header. Can you show how it looks with a signature?

@bcs018
Copy link
Author

bcs018 commented Feb 2, 2024

@Synchro Do you want me to capture the output of $mail->SMTPDebug = 2; with the signature?

@marcosruberguer
Copy link

It's happening to me too, I don't know what to do anymore. Have any of you solved the problem?

@Synchro
Copy link
Member

Synchro commented Feb 5, 2024

@Synchro Do you want me to capture the output of $mail->SMTPDebug = 2; with the signature?

Yes. I'm guessing that something is messing up the MIME structure when signing a message, but I need an example of it failing to see what it's doing.

@bcs018
Copy link
Author

bcs018 commented Feb 5, 2024

This first one is an example with a signature

2024-02-05 17:06:21 SERVER -> CLIENT: 220 ######
2024-02-05 17:06:21 CLIENT -> SERVER: EHLO localhost
2024-02-05 17:06:22 SERVER -> CLIENT: 250-#####.####.####.##250-PIPELINING250-SIZE 68500000250-VRFY250-ETRN250-STARTTLS250-AUTH LOGIN PLAIN250-AUTH=LOGIN PLAIN250-ENHANCEDSTATUSCODES250-8BITMIME250-DSN250 CHUNKING
2024-02-05 17:06:22 CLIENT -> SERVER: AUTH LOGIN
2024-02-05 17:06:22 SERVER -> CLIENT: 334 ########
2024-02-05 17:06:22 CLIENT -> SERVER: [credentials hidden]
2024-02-05 17:06:22 SERVER -> CLIENT: 334 UGFzc3dvcmQ6
2024-02-05 17:06:22 CLIENT -> SERVER: [credentials hidden]
2024-02-05 17:06:22 SERVER -> CLIENT: 235 2.7.0 Authentication successful
2024-02-05 17:06:22 CLIENT -> SERVER: MAIL FROM:<#######@#####.####.br>
2024-02-05 17:06:22 SERVER -> CLIENT: 250 2.1.0 Ok
2024-02-05 17:06:22 CLIENT -> SERVER: RCPT TO:<####@#####.com>
2024-02-05 17:06:22 SERVER -> CLIENT: 250 2.1.5 Ok
2024-02-05 17:06:22 CLIENT -> SERVER: DATA
2024-02-05 17:06:22 SERVER -> CLIENT: 354 End data with .
2024-02-05 17:06:22 CLIENT -> SERVER: Date: Mon, 5 Feb 2024 14:06:21 -0300
2024-02-05 17:06:22 CLIENT -> SERVER: To: ####@#####.com
2024-02-05 17:06:22 CLIENT -> SERVER: From: ################## <####@#####.com>
2024-02-05 17:06:22 CLIENT -> SERVER: Subject: Altere a sua senha
2024-02-05 17:06:22 CLIENT -> SERVER: Message-ID: P5AFjjVjHi0011rmzXWSRbrde81DBcaFQplaXb2E@localhost
2024-02-05 17:06:22 CLIENT -> SERVER: X-Mailer: PHPMailer 6.9.1 (https://github.com/PHPMailer/PHPMailer)
2024-02-05 17:06:22 CLIENT -> SERVER: MIME-Version: 1.0
2024-02-05 17:06:22 CLIENT -> SERVER: Content-Type: multipart/signed; protocol="application/x-pkcs7-signature"; micalg="sha-256"; boundary="----0835CFEDABC5312DD54C84F9A8A71063"
2024-02-05 17:06:22 CLIENT -> SERVER:
2024-02-05 17:06:22 CLIENT -> SERVER: This is an S/MIME signed message
2024-02-05 17:06:22 CLIENT -> SERVER:
2024-02-05 17:06:22 CLIENT -> SERVER: ------0835CFEDABC5312DD54C84F9A8A71063
2024-02-05 17:06:22 CLIENT -> SERVER: Content-Type: text/html; charset=UTF-8
2024-02-05 17:06:22 CLIENT -> SERVER: Content-Transfer-Encoding: 8bit
2024-02-05 17:06:22 CLIENT -> SERVER:
2024-02-05 17:06:22 CLIENT -> SERVER: <div style=3D"font-family:Verdana,Arial,Helvetica,Sans-Serif; font-size:12p=
2024-02-05 17:06:22 CLIENT -> SERVER: x;">

Esqueceu a senha do seu usu=C3=A1rio?

Ent=C3=A3o CLIQUE AQUI<=
2024-02-05 17:06:22 CLIENT -> SERVER: /a> para recadastr=C3=A1-la!

Qualquer d=C3=BAvida entre em contato c=
2024-02-05 17:06:22 CLIENT -> SERVER: onosco!

Telefone:(19) ########
E-mail: =
2024-02-05 17:06:22 CLIENT -> SERVER:
####@#####.com

Obrigado!

Favor n=
2024-02-05 17:06:22 CLIENT -> SERVER: =C3=A3o responder este e-mail. Para obter ajuda ligue (19) #########
</=
2024-02-05 17:06:22 CLIENT -> SERVER: strong>


AVISO LEGAL: Esta mensagem =C3=A9 desti=
2024-02-05 17:06:22 CLIENT -> SERVER: nada exclusivamente para a(s)
pessoa(s) a quem =C3=A9 dirigida, podendo=
2024-02-05 17:06:22 CLIENT -> SERVER: conter informa=C3=A7=C3=A3o confidencial e/ou
legalmente privi=
2024-02-05 17:06:22 CLIENT -> SERVER: legiada. Se voc=C3=AA n=C3=A3o for destinat=C3=A1rio desta mensagem, =
2024-02-05 17:06:22 CLIENT -> SERVER:
desde j=C3=A1 fica notificado de abster-se a divulgar, copiar, dis=
2024-02-05 17:06:22 CLIENT -> SERVER: tribuir,
examinar ou, de qualquer forma, utilizar a informa=
2024-02-05 17:06:22 CLIENT -> SERVER: =C3=A7=C3=A3o contida nesta
mensagem, por ser ilegal. Caso=
2024-02-05 17:06:22 CLIENT -> SERVER: voc=C3=AA tenha recebido esta mensagem por
engano, pedimos=
2024-02-05 17:06:22 CLIENT -> SERVER: que nos retorne este E-Mail, promovendo, desde logo, a
elimi=
2024-02-05 17:06:22 CLIENT -> SERVER: na=C3=A7=C3=A3o do seu conte=C3=BAdo em sua base de dados, registros ou sis=
2024-02-05 17:06:22 CLIENT -> SERVER: tema de
controle. Fica desprovida de efic=C3=A1cia e validade a=
2024-02-05 17:06:22 CLIENT -> SERVER: mensagem que contiver
v=C3=ADnculos obrigacionais, expedida po=
2024-02-05 17:06:22 CLIENT -> SERVER: r quem n=C3=A3o detenha poderes de
representa=C3=A7=
2024-02-05 17:06:22 CLIENT -> SERVER: =C3=A3o.

LEGAL ADVICE: This message is exclusively d=
2024-02-05 17:06:22 CLIENT -> SERVER: estined for the people to whom
it is directed, and it can bear private =
2024-02-05 17:06:22 CLIENT -> SERVER: and/or legally exceptional
information. If you =
2024-02-05 17:06:22 CLIENT -> SERVER: are not addressee of this message, since now you are
=
2024-02-05 17:06:22 CLIENT -> SERVER: advised to not release, copy, distribute, check or, otherwise, use the =
2024-02-05 17:06:22 CLIENT -> SERVER:
information contained in this message, because it is il=
2024-02-05 17:06:22 CLIENT -> SERVER: legal. If you
received this message by mistake, w=
2024-02-05 17:06:22 CLIENT -> SERVER: e ask you to return this email, making
possible, as so=
2024-02-05 17:06:22 CLIENT -> SERVER: on as possible, the elimination of its contents of your =
2024-02-05 17:06:22 CLIENT -> SERVER:
database, registrations or controls system. The message that bears any=
2024-02-05 17:06:22 CLIENT -> SERVER:
mandatory links, issued by someone who has no repr=
2024-02-05 17:06:22 CLIENT -> SERVER: esentation powers, shall
be null or void.


2024-02-05 17:06:22 CLIENT -> SERVER: ------0835CFEDABC5312DD54C84F9A8A71063
2024-02-05 17:06:22 CLIENT -> SERVER: Content-Type: application/x-pkcs7-signature; name="smime.p7s"
2024-02-05 17:06:22 CLIENT -> SERVER: Content-Transfer-Encoding: base64
2024-02-05 17:06:22 CLIENT -> SERVER: Content-Disposition: attachment; filename="smime.p7s"
2024-02-05 17:06:22 CLIENT -> SERVER:
2024-02-05 17:06:22 CLIENT -> SERVER: MIIK+QYJKoZIhvcNAQcCoIIK6jCCCuYCAQExDzANBglghkgBZQMEAgEFADALBgkq
2024-02-05 17:06:22 CLIENT -> SERVER: hkiG9w0BBwGggggeMIIIGjCCBgKgAwIBAgIQUqa3VDWEe8qWJP+HcLDqZDANBgkq
2024-02-05 17:06:22 CLIENT -> SERVER: hkiG9w0BAQsFADB4MQswCQYDVQQGEwJCUjETMBEGA1UEChMKSUNQLUJyYXNpbDE2
2024-02-05 17:06:22 CLIENT -> SERVER: MDQGA1UECxMtU2VjcmV0YXJpYSBkYSBSZWNlaXRhIEZlZGVyYWwgZG8gQnJhc2ls
2024-02-05 17:06:22 CLIENT -> SERVER: IC0gUkZCMRwwGgYDVQQDExNBQyBDZXJ0aXNpZ24gUkZCIEc1MB4XDTIzMTIxOTE1
2024-02-05 17:06:22 CLIENT -> SERVER: MjY0NVoXDTI0MTIxODE1MjY0NVowggENMQswCQYDVQQGEwJCUjETMBEGA1UECgwK
2024-02-05 17:06:22 CLIENT -> SERVER: SUNQLUJyYXNpbDELMAkGA1UECAwCU1AxEzARBgNVBAcMCk1vZ2kgR3VhY3UxEzAR
2024-02-05 17:06:22 CLIENT -> SERVER: BgNVBAsMClByZXNlbmNpYWwxFzAVBgNVBAsMDjQ0NzY3MDkzMDAwMTUwMTYwNAYD
2024-02-05 17:06:22 CLIENT -> SERVER: VQQLDC1TZWNyZXRhcmlhIGRhIFJlY2VpdGEgRmVkZXJhbCBkbyBCcmFzaWwgLSBS
2024-02-05 17:06:22 CLIENT -> SERVER: RkIxFjAUBgNVBAsMDVJGQiBlLUNOUEogQTExSTBHBgNVBAMMQFVOSU1FRCBSRUdJ
2024-02-05 17:06:22 CLIENT -> SERVER: T05BTCBEQSBCQUlYQSBNT0dJQU5BIENPT1AgVFJBQkFMSE8gTUU6NDkyMTA5NjYw
2024-02-05 17:06:22 CLIENT -> SERVER: MDAxNDIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC9EYdBwPkXjREY
2024-02-05 17:06:22 CLIENT -> SERVER: KvdharWUSeeS8ZV3fu3CxyyCo1vm/eOcuP/1/nNMh22A5HbYOSR4pWeVPYbobYPf
2024-02-05 17:06:22 CLIENT -> SERVER: 46FRgcbzQUZmVSRduHWjOc54CBMr48TLxQWtthwJn3x+FC/dMU6pBr8tl/EdF/x8
2024-02-05 17:06:22 CLIENT -> SERVER: M+ufrURB4rlCiyWcFZULwyVA5G8u7hBW8U2fOT3M6478WMp7kx/FFCKMWFHMxIuU
2024-02-05 17:06:22 CLIENT -> SERVER: s7CqZgxu1uHA3R/RQzGwAa+SnEJbsNlRSv7+MIOpnNWb6wFgaUBJyURpEXRM8sL3
2024-02-05 17:06:22 CLIENT -> SERVER: BJ6HGwpUZe/IdafgaydkjbHzABFs6T9zqJaH5a0mFbW6pax/XQ6jc4QDqi+jCsmD
2024-02-05 17:06:22 CLIENT -> SERVER: jH6w6MO3AgMBAAGjggMHMIIDAzCBtgYDVR0RBIGuMIGroDgGBWBMAQMEoC8ELTA2
2024-02-05 17:06:22 CLIENT -> SERVER: MDMxOTUzMjAyOTU8rtfa25c8rrswMDAwMDAwMDAwMDAwMDAwMDAwMDAwMKAfBgVg
2024-02-05 17:06:22 CLIENT -> SERVER: TAEDAqAWBBRESUxWTyBGRVJSRUlSQSBMT1BFU6AZBgVgTAEDA6AQBA40OTIxMDk2
2024-02-05 17:06:22 CLIENT -> SERVER: NjAwMDE0MqAXBgVgTAEDB6AOBAwwMDAwMDAwMDAwMDCBGmdyYWNpZXRlQHVuaW1l
2024-02-05 17:06:22 CLIENT -> SERVER: ZGJ4bS5jb29wLmJyMAkGA1UdEwQCMAAwHwYDVR0jBBgwFoAUU31/nb7RYdAgutqf
2024-02-05 17:06:22 CLIENT -> SERVER: 44mnE3NYzUIwfwYDVR0gBHgwdjB0BgZgTAECAQwwajBoBggrBgEFBQcCARZcaHR0
2024-02-05 17:06:22 CLIENT -> SERVER: cDovL2ljcC1icmFzaWwuY2VydGlzaWduLmNvbS5ici9yZXBvc2l0b3Jpby9kcGMv
2024-02-05 17:06:22 CLIENT -> SERVER: QUNfQ2VydGlzaWduX1JGQi9EUENfQUNfQ2VydGlzaWduX1JGQi5wZGYwgbwGA1Ud
2024-02-05 17:06:22 CLIENT -> SERVER: HwSBtDCBsTBXoFWgU4ZRaHR0cDovL2ljcC1icmFzaWwuY2VydGlzaWduLmNvbS5i
2024-02-05 17:06:22 CLIENT -> SERVER: ci9yZXBvc2l0b3Jpby9sY3IvQUNDZXJ0aXNpZ25SRkJHNS9MYXRlc3RDUkwuY3Js
2024-02-05 17:06:22 CLIENT -> SERVER: MFagVKBShlBodHR45vf54d4v5df4vfddzzzxldXRyYWxjci5jb20uYnIvcmVwb3N
2024-02-05 17:06:22 CLIENT -> SERVER: dG9yaW8vbGNyL0FDQ2VydGlzaWduUkZCRzUvTGF0ZXN0Q1JMLmNybDAOBgNVHQ8B
2024-02-05 17:06:22 CLIENT -> SERVER: Af8EBAMCBeAwHQYDVR0lBBYwFAYIKwYBBQUHAwIGCCsGAQUFBwMEMIGsBggrBgEF
2024-02-05 17:06:22 CLIENT -> SERVER: BQcBAQSBnzCBnDBfBggrBgEFBQcwAoZTaHR0cDovL2ljcC1icmFzaWwuY2VydGlz
2024-02-05 17:06:22 CLIENT -> SERVER: aWduLmNvbS5ici9yZXBvc2l0b3Jpby9jZXJ0aWZpY2Fkb3MvQUNfQ2VydGlzaWdu
2024-02-05 17:06:22 CLIENT -> SERVER: X1JGQl9HNS5wN2MwOQYIKwYBBQUHMAGGLWh0dHA6Ly9vY3NwLWFjLWNlcnRpc2ln
2024-02-05 17:06:22 CLIENT -> SERVER: bi1yZmIuY2VydGlzaWduLmNvbS5icjANBgkqhkiG9w0BAQsFAAOCAgEAOOx7Zrff
2024-02-05 17:06:22 CLIENT -> SERVER:
2024-02-05 17:06:22 CLIENT -> SERVER: ------0835CFEDABC5312DD54C84F9A8A71063--
2024-02-05 17:06:22 CLIENT -> SERVER:
2024-02-05 17:06:22 CLIENT -> SERVER:
2024-02-05 17:06:22 CLIENT -> SERVER: .
2024-02-05 17:06:22 SERVER -> CLIENT: 250 2.0.0 Ok: queued as 9CD734090D6F
2024-02-05 17:06:22 CLIENT -> SERVER: QUIT
2024-02-05 17:06:22 SERVER -> CLIENT: 221 2.0.0 Bye

This one is without a signature:

2024-02-05 17:12:50 SERVER -> CLIENT: 220 #####.####.####.br
2024-02-05 17:12:50 CLIENT -> SERVER: EHLO localhost
2024-02-05 17:12:50 SERVER -> CLIENT: 250-#####.####.####.br250-PIPELINING250-SIZE 68500000250-VRFY250-ETRN250-STARTTLS250-AUTH LOGIN PLAIN250-AUTH=LOGIN PLAIN250-ENHANCEDSTATUSCODES250-8BITMIME250-DSN250 CHUNKING
2024-02-05 17:12:50 CLIENT -> SERVER: AUTH LOGIN
2024-02-05 17:12:50 SERVER -> CLIENT: 334 VXNlcm5hbWU6
2024-02-05 17:12:50 CLIENT -> SERVER: [credentials hidden]
2024-02-05 17:12:50 SERVER -> CLIENT: 334 UGFzc3dvcmQ6
2024-02-05 17:12:50 CLIENT -> SERVER: [credentials hidden]
2024-02-05 17:12:50 SERVER -> CLIENT: 235 2.7.0 Authentication successful
2024-02-05 17:12:50 CLIENT -> SERVER: MAIL FROM:<#####@####.###.br>
2024-02-05 17:12:50 SERVER -> CLIENT: 250 2.1.0 Ok
2024-02-05 17:12:50 CLIENT -> SERVER: RCPT TO:<#####@####.###.br>
2024-02-05 17:12:50 SERVER -> CLIENT: 250 2.1.5 Ok
2024-02-05 17:12:50 CLIENT -> SERVER: DATA
2024-02-05 17:12:50 SERVER -> CLIENT: 354 End data with .
2024-02-05 17:12:50 CLIENT -> SERVER: Date: Mon, 5 Feb 2024 14:12:50 -0300
2024-02-05 17:12:50 CLIENT -> SERVER: To: #####@####.###.br
2024-02-05 17:12:50 CLIENT -> SERVER: From: ##### ###### <#####@####.###.br>
2024-02-05 17:12:50 CLIENT -> SERVER: Subject: Altere a sua senha
2024-02-05 17:12:50 CLIENT -> SERVER: Message-ID: r5C98vlUc0QFTdFNeaJuWyy5aosqn9OENF2VTCig@localhost
2024-02-05 17:12:50 CLIENT -> SERVER: X-Mailer: PHPMailer 6.9.1 (https://github.com/PHPMailer/PHPMailer)
2024-02-05 17:12:50 CLIENT -> SERVER: MIME-Version: 1.0
2024-02-05 17:12:50 CLIENT -> SERVER: Content-Type: text/html; charset=UTF-8
2024-02-05 17:12:50 CLIENT -> SERVER: Content-Transfer-Encoding: quoted-printable
2024-02-05 17:12:50 CLIENT -> SERVER:
2024-02-05 17:12:50 CLIENT -> SERVER: <div style=3D"font-family:Verdana,Arial,Helvetica,Sans-Serif; font-size:12p=
2024-02-05 17:12:50 CLIENT -> SERVER: x;">

Esqueceu a senha do seu usu=C3=A1rio?

Ent=C3=A3o CLIQUE AQUI<=
2024-02-05 17:12:50 CLIENT -> SERVER: /a> para recadastr=C3=A1-la!

Qualquer d=C3=BAvida entre em contato c=
2024-02-05 17:12:50 CLIENT -> SERVER: onosco!

Telefone:(19) #########
E-mail: =
2024-02-05 17:12:50 CLIENT -> SERVER:
#####@####.###.br

Obrigado!

Favor n=
2024-02-05 17:12:50 CLIENT -> SERVER: =C3=A3o responder este e-mail. Para obter ajuda ligue (19) ########
</=
2024-02-05 17:12:50 CLIENT -> SERVER: strong>


AVISO LEGAL: Esta mensagem =C3=A9 desti=
2024-02-05 17:12:50 CLIENT -> SERVER: nada exclusivamente para a(s)
pessoa(s) a quem =C3=A9 dirigida, podendo=
2024-02-05 17:12:50 CLIENT -> SERVER: conter informa=C3=A7=C3=A3o confidencial e/ou
legalmente privi=
2024-02-05 17:12:50 CLIENT -> SERVER: legiada. Se voc=C3=AA n=C3=A3o for destinat=C3=A1rio desta mensagem, =
2024-02-05 17:12:50 CLIENT -> SERVER:
desde j=C3=A1 fica notificado de abster-se a divulgar, copiar, dis=
2024-02-05 17:12:50 CLIENT -> SERVER: tribuir,
examinar ou, de qualquer forma, utilizar a informa=
2024-02-05 17:12:50 CLIENT -> SERVER: =C3=A7=C3=A3o contida nesta
mensagem, por ser ilegal. Caso=
2024-02-05 17:12:50 CLIENT -> SERVER: voc=C3=AA tenha recebido esta mensagem por
engano, pedimos=
2024-02-05 17:12:50 CLIENT -> SERVER: que nos retorne este E-Mail, promovendo, desde logo, a
elimi=
2024-02-05 17:12:50 CLIENT -> SERVER: na=C3=A7=C3=A3o do seu conte=C3=BAdo em sua base de dados, registros ou sis=
2024-02-05 17:12:50 CLIENT -> SERVER: tema de
controle. Fica desprovida de efic=C3=A1cia e validade a=
2024-02-05 17:12:50 CLIENT -> SERVER: mensagem que contiver
v=C3=ADnculos obrigacionais, expedida po=
2024-02-05 17:12:50 CLIENT -> SERVER: r quem n=C3=A3o detenha poderes de
representa=C3=A7=
2024-02-05 17:12:50 CLIENT -> SERVER: =C3=A3o.

LEGAL ADVICE: This message is exclusively d=
2024-02-05 17:12:50 CLIENT -> SERVER: estined for the people to whom
it is directed, and it can bear private =
2024-02-05 17:12:50 CLIENT -> SERVER: and/or legally exceptional
information. If you =
2024-02-05 17:12:50 CLIENT -> SERVER: are not addressee of this message, since now you are
=
2024-02-05 17:12:50 CLIENT -> SERVER: advised to not release, copy, distribute, check or, otherwise, use the =
2024-02-05 17:12:50 CLIENT -> SERVER:
information contained in this message, because it is il=
2024-02-05 17:12:50 CLIENT -> SERVER: legal. If you
received this message by mistake, w=
2024-02-05 17:12:50 CLIENT -> SERVER: e ask you to return this email, making
possible, as so=
2024-02-05 17:12:50 CLIENT -> SERVER: on as possible, the elimination of its contents of your =
2024-02-05 17:12:50 CLIENT -> SERVER:
database, registrations or controls system. The message that bears any=
2024-02-05 17:12:50 CLIENT -> SERVER:
mandatory links, issued by someone who has no repr=
2024-02-05 17:12:50 CLIENT -> SERVER: esentation powers, shall
be null or void.


2024-02-05 17:12:50 CLIENT -> SERVER: .
2024-02-05 17:12:50 SERVER -> CLIENT: 250 2.0.0 Ok: queued as 541504090D6F
2024-02-05 17:12:50 CLIENT -> SERVER: QUIT
2024-02-05 17:12:50 SERVER -> CLIENT: 221 2.0.0 Bye

@bcs018
Copy link
Author

bcs018 commented Feb 5, 2024

@Synchro I thought it was better to put it as an image because text gets disfigured.

This first one is an example with a signature:
log com ass 1
log com ass 2

This one is without a signature:

log sem ass

@bcs018
Copy link
Author

bcs018 commented Feb 5, 2024

@Synchro I managed to find out where the problem was, instead of using $mail->Body to write the message, use $mail->msgHTML().
It worked out perfectly, thank you for your attention.

@Synchro
Copy link
Member

Synchro commented Feb 5, 2024

That's odd, but I'm glad it's working for you! msgHTML() is only a convenience wrapper – if you look at its code you'll see it does some minor rearranging of content to import images, but then it just sets Body and AltBody.

In the images, you can see that the signed one has a content transfer encoding of 8-bit, but the message itself contains quoted-printable-encoded content. The unsigned one has the same content, but the transfer encoding is correct (so you see properly decoded content when you receive the message). That's probably the underlying cause of what you're seeing, but I've not looked into how that can happen.

@Synchro Synchro closed this as completed Apr 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants