I am trying to assign a variable to email body in php but is not working.
$refer=$_POST['refer'];
send_mail( 'admin@auto-sal.es',
$_POST['email'],
'Invitation from ' .$name,
'Hi ".$refer."\n\n join me at auto-sal.es and get 1 month free membership');

I’ve tried using double quotes instead of single quotes but nothing happens any tips?
Try this:
You are enclosing the string in single quotes. Single quotes work differently from dobule quotes. If you put
"or a variable inside single quotes they will be interpreted literally, and that’s what is happening to you.You should also take a look at the official documentation that states: