Jump to content

Parsing IMAP Headers - Missing Content in braces.


420florida

Recommended Posts

I am trying to write a email bounce processing script. However, when I try to parse the headers (subject) or body, the email addresses are missing.

For example, the subject will say:

Delivery failure to <[email protected]>...

 

But when I view the Subject string, it shows:

Delivery failure to ...

 

The email address and braces are missing. This is the same with the body. Whenever there is braces and the email address, it is missing.

 

Can somebody help me figure out what is going on and provide a solution? I can't process the bounce without being able to grab the bounced email address!

 

Thanks!

Sean

 

Okay, still looking for help. Here is the code I am using that is giving me the problem. Can somebody PLEASE tell me why it won't show the email addresses in the subject or body?

 

<?php

    $conn = @imap_open("{mail.myserver.com:110/pop3/novalidate-cert}", "username", "password");

    $headers = @imap_headers($conn);

    if ($headers) {

          $email_count = sizeof($headers);

          for($i = 1; $i <= $email_count; $i++) {

        $mail_head = imap_headerinfo($conn, $i);

                  $mail_body = imap_fetchbody($conn, $i, 1);

echo "$mail_head->subject<BR>\n";

              }

    }

          @imap_expunge($conn);

          @imap_close($conn);

 

?>

 

This will loop through all my emails, but the subjects that say this:

 

Delivery Failure to <[email protected]>...

 

Show as this:

 

Delivery Failure to ...

 

The email address and braces are stripped out. I can't figure out why they are being stripped out of the Subject AND Body of the emails.

 

Help! This is driving me nuts!

Thanks,

Sean

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.