The mysterious message "example"

3

You see, I want to send someone a message in Laravel. I have this function:

// Enviamos a un usuario inactivo un mensaje de activación.
public function mensajeActivar(User $usuario){
    Mail::to($usuario->email)->send(new Mensajeria($usuario->id));

    return back()->with('message',['success',"Se ha enviado al usuario un mensaje que redirige al código de activación"]);
}

This is the Mensajeria.php code:

public $numero;

public function __construct($numero){
    $this->numero=$numero;
}

public function build(){
    return $this->view('correo.activacion');
}

And this is the activation code.blade.php:

<html lang="es">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0">
    <title>Active su cuenta en Bolsa Empleo</title>
</head> 
<body>
    <p>Se ha registrado con exito en el Aullido Vespertino.</p><br>
    <p>Pulse el siguiente enlace para activar su cuenta:</p><br>
    <a href='localhost/periodico/public/activar/{{$numero}}'>Activar su cuenta</a>
</body>
</html>

And this is the result:

Where does the mysterious text "Example" come from? Is there any way to remove it or replace it?

    
asked by Miguel Alparez 06.12.2018 в 17:28
source

1 answer

5

The one you see is the name of the sender of the email.

You have two ways to change it.

  • in config/mail.php

    set the property like this:

    'from' => ['address' => '[email protected]', 'name' => 'El nombre que quieres que se vea']
    

    This will be the default value for each email you send

  • The other is for that particular mail, in your code add:

    ->from('[email protected]', 'El nombre que quieres que se vea')
    

More information on the Mail documentation

    
answered by 06.12.2018 / 17:38
source