• 0
Sign in to follow this  
Rodrigo Louzada

Dúvida formulário PHP

Question

Fiz um formulário para um site, só que quando a pessoa preenche o formulário e envia, dá esse erro:

Warning: mail() [function.mail]: "sendmail_from" not set in php.ini or custom "From:" header missing in D:\inetpub\vhosts\infinitycustoms.com.br\httpdocs\emailform.php on line 11

e o meu script está assim:

1-<?php

2-

3-$to = "[email protected]";

4-$subject = "Contato Cliente";

5-$message = "Nome do Cliente: " . $_POST['nome'] . "\r\n" .

6-"Email: " . $_POST['email'] . "\r\n" .

7-"Mensagem: " . $_POST['mensagem'] . "\r\n" . "\r\n" .

8-$from = $_POST['email'];

9-$headers = "From: $from" . "\r\n";

10-$headers = "Bcc: [email protected]" . "\r\n";

11-mail($to,$subject,$message,$from,$headers);

?>

O nome do arquivo é emailform.php

Ainda estou aprendendo a programar e não sei o que pode estar errado, alguém pode me explicar qual o erro ??

obrigado.

Share this post


Link to post
Share on other sites

3 answers to this question

Recommended Posts

  • 0

troca o seu header por este e ve se da certo.

$headers = "From: ".$from."\nContent-type: text/html";

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this