Hey All,
Trying to retrieve email address from bounced email in mysql table.
I've got most of the addresses from bounced emails getting marked in my contacts table as invalid by a removeme.id.tag in the sent email, but sometimes the mailer daemon just returns something like the following in the email body without the removeme.id.tag.
This is an automatically generated Delevery Status Notification. Delivery To the following recipients failed. 'some.email@domain.com'
without the id.tag. So... how might I go about extracting the email address from the email body?
while ($row = mysql_fetch_assoc($result))
{ //$row['description'] == email body text
$description = $row['description'];
$str = 'This is an automatically generated Delevery Status Notification. Delivery To the following recipients failed.' ;
//$_split_email = preg_split ('//','$str', $description);
//$_split_email = array_shift(explode('$str', $description));
$_split_email = array_pop(explode('$description', $str,));
echo $_split_email;
}
Better Still... how might i just ignore all BUT the email string in the body, as the body text is bound to vary from one mailer_daemon to the next?