- if (!empty($email) && !$user->email) {
- mail_confirm_address($user, $confirm->code, $profile->nickname, $email);
+ if (!empty($email) && empty($user->email)) {
+ try {
+ $confirm->sendConfirmation();
+ } catch (EmailException $e) {
+ common_log(LOG_ERR, "Could not send user registration email for user id=={$profile->getID()}: {$e->getMessage()}");
+ if (!$accept_email_fail) {
+ throw $e;
+ }
+ }