Reputation: 411
I like to send a contact-form with a php cc-field.
My current code does not work:
$email_headers = "From: $vorname <$email>";
$email_headers .= "Cc: <$email>";
Upvotes: 0
Views: 97
Reputation: 3663
Use the following code :
$email_headers= 'From: Birthday Reminder <$email>' . "\r\n";
$email_headers .= 'Cc: $email' . "\r\n";
Hope this will work for you. You can check more from here too :http://php.net/manual/en/function.mail.php
Upvotes: 1
Reputation: 4136
You need to separate your headers lines with a carriage return \r\n
:
$email_headers = "From: $vorname <$email>" . "\r\n";
$email_headers .= "Cc: <$email>";
According the PHP mail documentation:
Multiple extra headers should be separated with a CRLF (\r\n).
Upvotes: 4