Ace Ace - 1 year ago 77
PHP Question

Laravel 5 Sending email to owner after a user register

Im using the default login and registration system of laravel. I just want to do whenever a new user were successfully registered an email will be sent to one of the email address that i will input, like sending an email to me to notify me that a new user register.

How will I do this?

Answer Source

You can simply overwrite register method in AuthController.

Put something like this and it will send super simple email to registered user:

public function register(Request $request)
    // original script, do not touch it
    $validator = $this->validator($request->all());

    if ($validator->fails()) {
            $request, $validator


    // Your custom script
    \Mail::raw('Welcome ' . $request->input('name') . '!', function ($m) use ($request) {
        $m->to($request->input('email'))->subject('Registration successful!');

    return redirect($this->redirectPath());

To learn more about mailing, You should read official docs:

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download