It works fine with email addresses without hyphens (e.g. digitalocean@hotmail.com). Does anyone know a possible cause for this?
Please ask if you need any more information.
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Hi @McCartheee,
This looks like some kind of an encoding issue nothing else. I’m not sure it’s actually part of the phpMailer class or just the way your strings are being saved.
Additionally, try to use the most up to date PHP version and see if the error would be again experienced.
This comment has been deleted
Now I can’t send emails at all. I get this line in my mail.log
I tried that and it didn’t work. I think it says somewhere that the name isn’t required anyway.
Looking at PHPMailer’s source code, it appears to encode a recipient email address only if there is a name. Try passing a name to addAddress(), does that work?
Here is the script. As you can see I’m using PHP Mailer
Thanks.
Can you share a sample of the code attempting to send the messages?
I have never encountered this myself when sending emails via php but some googling found a number of people reporting similar issues and the primary suggestions I found there were:
digital\-ocean@example.org
"digital-ocean@example.org"
<digital-ocean@example.org>