Hi
How do i retrieve the email address from an email with imap_open?
If the sender name is known i get the sender name instead of the email address if i use the 'from' parameter.
Hi
How do i retrieve the email address from an email with imap_open?
If the sender name is known i get the sender name instead of the email address if i use the 'from' parameter.
Worst case, you can parse the headers yourself with something like:
<?php
$headers=imap_fetchheader($imap, $msgid);
preg_match_all('/([^: ]+): (.+?(?:\r\n\s(?:.+?))*)\r\n/m', $headers, $matches);
?>
$matches will contain 3 arrays:
$matches[0] are the full-lines (such as "To: [email protected]\r\n")
$matches[1] will be the header (such as "To")
$matches[2] will be the value ([email protected])
Got this from: http://www.php.net/manual/en/function.imap-fetchheader.php#82339