php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #5644 imap_header function is broken
Submitted: 2000-07-17 14:09 UTC Modified: 2000-07-18 05:50 UTC
From: jeff at devrs dot com Assigned:
Status: Closed Package: IMAP related
PHP Version: 4.0 Release Candidate 2 OS: FreeBSD 4.0
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: jeff at devrs dot com
New email:
PHP Version: OS:

 

 [2000-07-17 14:09 UTC] jeff at devrs dot com
This example code works fine on PHP 3.0.16...

   $num=1;
   $link = imap_open($MAILSERVER,$PHP_AUTH_USER,$PHP_AUTH_PW);
   $header = imap_header($link,$num);

   echo  "From: $header[fromaddress]<br>";
   echo  "To: $header[toaddress]<br>";
   echo  "Date: $header[Date]<br>";
   echo  "Subject: $header[Subject]<br><br>";
   echo nl2br(imap_body($link,$num));

...but on 4.0.1r2 the "imap_header" function returns only zero length strings.

./configure '--with-apxs=/opt/Apache/bin/apxs' '--with-mysql=/opt/Mysql'
  '--with-pgsql=/opt/Postgres' '--with-ldap=/opt/Ldap' '--with-imap=../../mail/imap-4.7c/c-client'
     '--with-config-file-path=/opt/Apache/conf' '--enable-track-vars' '--enable-magic-quotes'

 Thanks,
 Jeff

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-07-18 05:50 UTC] hholzgra at cvs dot php dot net
imap_header returns an object, not an array

so the "Right Thing (tm)" to do is using
$header->fromaddress instead of $header[fromaddress]

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Sep 21 00:01:27 2024 UTC