420florida Posted June 4, 2009 Share Posted June 4, 2009 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 Link to comment https://forums.phpfreaks.com/topic/160932-parsing-imap-headers-missing-content-in-braces/ Share on other sites More sharing options...
420florida Posted June 4, 2009 Author Share Posted June 4, 2009 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 Link to comment https://forums.phpfreaks.com/topic/160932-parsing-imap-headers-missing-content-in-braces/#findComment-849586 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.