Why when sending emails in php "does not work" variables?

Tell me why when sending emails in php "does not work" variables?

Part of the code:
$to = $data['login'];
$subject = 'Registration was successful!';
$message = '
<html>
the <body>

<p>
Hello, <b>'. $data['name'] .'</b><br/>
You have successfully registered in the system — ****</b>.

<br/><br/>

Your login: <b>'. $data['login'] .'</b><br/>
You can log in to your account at <a href="/'. $sevrice->name .'">...</a> by entering your username and password.
</p>

</body>
</html>
';

That is $to = $data['login'] is working fine, a letter is sent to the entered email.address, but the fact that the body of the letter is skipped, they're really just spaces. How can I fix it?
March 19th 20 at 08:39
1 answer
March 19th 20 at 08:41
So there you have no data. Why did you decide that those variables are there?
1. Turn on the error output, let's see what happens.
2. Walk by a debugger, there also will be seen that you have in a variable.
Because when you registered, enter email and letter to this e-mail comes, then everything works correctly, but in the body of the letter on the same principle — no. Included error output — nothing - anibal_Bernier65 commented on March 19th 20 at 08:44
@anibal_Bernier65that page correctly left the data fields must be given a name by which they will be available in PHP, you can not see all code and error context. - garrison36 commented on March 19th 20 at 08:47
@garrison36, understood, thanks - anibal_Bernier65 commented on March 19th 20 at 08:50

Find more questions by tags PHP