Sending of PHP Form

Asked

Viewed 66 times

0

I have a problem sending my website form via PHP. I even followed the example of my hosting, Locaweb, but the submission is not done. Can someone help me?

<?php

$quebra_linha = "\n";
$emailsender = "[email protected]";
$nomeremetente = "Fabrica da Limpeza";
$emaildestinatario = "[email protected]";
$assunto = "Contato via Site";
$mensagem = "blabla";

$mensagemHTML = 'teste'.$mensagem.'';

$headers = "MIME-Version: 1.1".$quebra_linha;
$headers .= "Content-type: text/html; charset=iso-8859-1".$quebra_linha;
$headers .= "From: ".$emailsender.$quebra_linha;
$headers .= "Return-Patch: ".$emailsender.$quebra_linha;
$headers .= "Reply-To: ".$emailsender.$quebra_linha;

mail ($emaildestinatario, $assunto, $mensagemHTML, $headers , "-r". $emailsender);

?>
  • Sending form or email is not done?

  • Sending Email is not done :S

  • He contacted the lodging, something was commented?

  • 1

    They say nothing because the code is my responsibility ' But I believe there is nothing wrong with my code .

  • 1

    Try it this way if(!mail ($emaildestinatario, $assunto, $mensagemHTML, $headers)){ echo 'erro'; }

1 answer

0

Since your "variables" are constant, I recommend that you put the name directly in the body of the message and not in other variables. Example:

$headers .= "From:[email protected]" . \r \n; 

In place of:

$headers .= "From: ".$emailsender.$quebra_linha;

I don’t know if that’s it, but it could be... If it is a server configuration error, try to force an error or contact your server services.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.