Hello,
I am trying to create a mail function for my contact form and for my registration system.
But I repeatedly getting the same error:
Warning: mail() [function.mail]: "sendmail_f rom" not set in php.ini or custom "From:" header missing in C:\xampp\htdocs \website\actie. php on line 21
I've already searched for solutions on google, but I couldn't find one which solved my problem.
the things I've tried to change:
smtp in php.ini and the sendmail_from (none of the php.ini files found in xampp/php/php.ini changed a value in the phpinfo)
mercury mail server from xampp activated.
the code for my contact form is split up in 2 php files with the following code
contact.php
action.php
and the part of my registration file which won't send the mail:
thanks for reading and many thanks if you can help me with this problem.
I am trying to create a mail function for my contact form and for my registration system.
But I repeatedly getting the same error:
Warning: mail() [function.mail]: "sendmail_f rom" not set in php.ini or custom "From:" header missing in C:\xampp\htdocs \website\actie. php on line 21
I've already searched for solutions on google, but I couldn't find one which solved my problem.
the things I've tried to change:
smtp in php.ini and the sendmail_from (none of the php.ini files found in xampp/php/php.ini changed a value in the phpinfo)
mercury mail server from xampp activated.
the code for my contact form is split up in 2 php files with the following code
contact.php
Code:
<form method="POST" action="actie.php"><br> Name:<br><input type="text" name="naam" size="50"><br> E-mail:<br><input type="text" name="email" size="50"></select><br> Subject:<br><input type="text" name="subject" size="50"></select><br> Tekst:<br><textarea rows="3" name="tekst" cols="75"></textarea> <br><input type="submit" name="verzend" value="Verzenden">
Code:
$ontvanger = "my email@address.com"; $onderwerp = "Iemand heeft je formulier ingevuld"; // We definiƫren vervolgens de veranderlijke variabelen. $naam = $_POST['naam']; $email = $_POST['email']; $subject = $_POST['subject']; $tekst = $_POST['tekst']; $headers= 'To: <michael.bruin@live.nl>' . "\r\n"; // Bericht $bericht = "Iemand heeft je contactformulier ingevuld.\nHet gaat om '".$naam."', met het e-mailadres '".$email."', wonende in '".$subject."'. Hij vulde de volgende opmerking in:\n'".$tekst."'"; $tekst = str_replace("\n.", "\n..", $tekst); // Verzenden mail($ontvanger, $onderwerp, $bericht, $headers); // Bericht verzonden echo "Uw bericht werd verzonden.";
Code:
$mail = mail($_POST['email'],"Registratie ".$sitenaam,$bericht,"From: ".$sitenaam." <".$sitemail.">");
Comment