Answer the question
In order to leave comments, you need to log in
Swift_RfcComplianceException - how to fix the error?
I get an error when sending a mail - Swift_RfcComplianceException
Address in mailbox given [] does not comply with RFC 2822, 3.6.2.
The code:
$input = Input::all();
$validator = Validator::make(
$input,
array(
'pass' => 'required|min:5|confirmed',
'email' => 'required|email'
));
if ($validator->fails()) {
$messages = $validator->messages();
return Redirect::to('registration')->withErrors($messages)->withInput();
}else{
try{
$user = Sentry::register(array(
'email' => $input['email'],
'password' => $input['pass']
));
$data = array('code' => $user->getActivationCode());
$email = $input['email'];
Mail::send('emails.activation', $data, function($message)
{
global $email;
$message->to($email)->subject('Спасибо за регистрацию!');
});
}catch(Cartalyst\Sentry\Users\UserExistsException $e){
return Redirect::to('registration')->with('mes','Данный пользователь уже существует!')->withInput();
}
}
return View::make('registration_success');
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question