<?php

$s = "andrew garfield invited as andrew@gomail.com or man@ohman.com";
$res = array();
preg_match_all('~\S+@\S+~', $s, $res);
print_r($res);