PEAR Mail - address list issue

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
shawngoldw
Forum Contributor
Posts: 212
Joined: Mon Apr 05, 2010 3:38 pm

PEAR Mail - address list issue

Post by shawngoldw »

Hey, I'm using PEAR Mail to send email from my server through gmail. I am having a problem with sending emails to a list of users though. I build a list of email address to use as the 'to' field of the email but say my list looks like this:

Code: Select all

'Bob Vance' <bobvance@gmail.com>, 'Tim Smith' <timsmith@hotmail.com>, 'Aleksándr Chu' <aleksandrchu@yahoo.com>
no one will receive the email.

It will work if it looks like this instead:

Code: Select all

'Bob Vance' <bobvance@gmail.com>, 'Tim Smith' <timsmith@hotmail.com>, 'Aleksandr Chu' <aleksandrchu@yahoo.com>
The difference is hard to spot, but in the first case there in an accent in Aleksándr which is not in the second case.


If anyone could explain why the accent breaks the system or how to fix it it would be appreciated. If I am unclear please let me know and I will try to clarify.

Thanks,
Shawn
User avatar
Jade
Forum Regular
Posts: 908
Joined: Sun Dec 29, 2002 5:40 pm
Location: VA

Re: PEAR Mail - address list issue

Post by Jade »

The problem is that the accent isn't in the encoding. Try changing using ord and convert it to ascii: http://www.asciitable.com/
shawngoldw
Forum Contributor
Posts: 212
Joined: Mon Apr 05, 2010 3:38 pm

Re: PEAR Mail - address list issue

Post by shawngoldw »

Thank you, ord converts the first character of a string to it's ascii value, how can I find and convert every alphabetical (not alphanumeric) character to ascii?
Post Reply