Pear POP3 and getting the sender"s email address

Pear POP3 and getting the sender"s email address

am 05.11.2009 13:46:11 von Dave M G

PHP Users,

I have implemented the POP3 class in the Pear libraries to retrieve
emails with PHP:
http://pear.php.net/manual/en/package.networking.net-pop3.ge tparsedheaders.php

It's basically working fine. I can download mail, get headers, all that
good stuff.

The problem is, when I extract the "From" header, it's not the email of
the sender. It's their just their name.

Unless I'm overlooking the obvious, there isn't a field that simply
states the sender's original sending address.

Surely that information is available...?

How do I get the sender's email address?

Any advice would be much appreciated.

-- Dave M G


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: Pear POP3 and getting the sender"s email address

am 05.11.2009 13:56:30 von Regular email

Hi,

> The problem is, when I extract the "From" header, it's not the email of
> the sender. It's their just their name.

It is probably the fact that it looks like this:

Richard Heyes

Because the address is in angle brackets, it's being interpreted as a
HTML tag by your web browser. Try viewing the sauce and it may be
there. If so, you will need to pass the string through
htmlspecialchars() before displaying it.

If on the other hand you want the envelope sender (ie the SMTP sender
address), then you're out of luck as the envelope is lost when the
email is stored in POP3.

--
Richard Heyes
HTML5 graphing: RGraph - www.rgraph.net (updated 31st October)
Lots of PHP and Javascript code - http://www.phpguru.org

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: Pear POP3 and getting the sender"s email address [SOLVED]

am 05.11.2009 14:22:14 von Dave M G

Richard,

Thank you for responding.

> ..you will need to pass the string through
> htmlspecialchars() before displaying it.

Oh there it is! I keep forgetting about those angle brackets.

Thank you for your quick and concise answer!

--
Dave M G

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php