Skip to content
Discussion options

You must be logged in to vote

The UseSMTPUTF8 property is set dynamically in preSend. It will automatically be assigned the appropriate value – setting it yourself will have no effect.

By default PHPMailer uses PHP's built-in filter_var validator, which does not handle SMTPUTF8 addresses. If you're expecting to use addresses that require SMTPUTF8, the validator needs to expect that, and until you've called addAddress and set CharSet, it can't know which validator to use automatically. So if you're calling it in isolation, you need to tell it which validator pattern to use beforehand. Add this near the top of your script, before you try to add any addresses:

    PHPMailer::$validator = 'eai';

This is covered in the doc…

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
3 replies
@Synchro
Comment options

@tnbnicer
Comment options

@Synchro
Comment options

Answer selected by tnbnicer
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants