0, 'new' => 0, 'mod' => 0, 'match' => 0];
$i = $check->Nmsgs;
$result['count'] = $i;
// Paypal
while($i > 0){
$body = imap_body($imap, $i);
$b64 = imap_base64($body);
if($b64){
$body = $b64;
}
$regex_name = '/Name des Kunden:<\/th>
(.*) (.*)<\/td>/mU';
$regex_mail = '/E-Mail des Kunden:<\/th>(.*)<\/td>/mU';
$first_name = null;
$last_name = null;
$email = null;
preg_match_all($regex_name, $body, $matches, \PREG_SET_ORDER);
if($matches){
$first_name = $matches[0][1];
$last_name = $matches[0][2];
}
preg_match_all($regex_mail, $body, $matches, \PREG_SET_ORDER);
if($matches){
$email = $matches[0][1];
}
if(!$email){
$regex_single = '/Diese E-Mail bestätigt den Erhalt einer Spende über €.+ von (.*) (.*) \(