Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $label = 'hardbounce';
- $hostname = "{imap.gmail.com:993/imap/ssl}$label";
- $username = 'support@quizlet.com';
- $password = 'XXXX';
- $imap_stream = imap_open($hostname,$username,$password) or die('Cannot connect to Gmail: ' . imap_last_error());
- $emails = imap_search($imap_stream, 'ALL');
- print "Total $label messages: " . count($emails) . "\n";
- $fh = fopen('hardbounces.log', 'a');
- foreach ($emails as $email):
- $body = imap_fetchbody($imap_stream, $email, '1');
- fwrite($fh, "$body\n==hardbounce==\n");
- if ($email % 100 == 0):
- print "Grabbed $email messages\n";
- endif;
- endforeach;
- fclose($fh);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement