Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $date = date('y-m-d');
- $hostname = '';
- $username = '';
- $password = '';
- $inbox = imap_open($hostname,$username,$password) or die('Cannot
- connect to mailbox: ' . imap_last_error());
- $emails = imap_search($inbox,'SUBJECT "Undelivered Mail Returned to Sender" ON "'.$date.'"');
- if($emails){
- rsort($emails);
- foreach($emails as $email){
- $overview = imap_fetch_overview($inbox,$email,0);
- $message = imap_body($inbox, $email);
- print_r($overview);
- print_r($message);
- echo '<br>';
- print_r($email);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement