Reputation: 21
How can I send the $email correctly?
$headers .= 'From: SUB: .$email.' . "\r\n";
Upvotes: 2
Views: 172
Reputation: 198115
You should make it quoted-printable:
$headers .= sprintf("From: \"SUB:\" <%s>\r\n", $email);
Will create a header-line like the following:
From: "SUB:" <[email protected]>
Upvotes: 0
Reputation: 29985
Either use double quotes (don't recommend it):
$headers .= "From: SUB: {$email}\r\n";
Or do it properly and get the variable outside the quotes:
$headers .= 'From: SUB: '.$email."\r\n";
As you can see, you were very close, but the ' should be placed before the first dot and not after the email variable :-)
Upvotes: 3
Reputation: 8508
$email should be in double quotes "From: Sub: $email\r\n";
or concat properly 'From: Sub: ' . $email . "\r\n
"
Upvotes: 2