PHP email sending, in HTML document

I was making an auto email application, where you would type in your name, email, question and the message. But it doesn’t work somehow… could anyone of you guys maybe see it? It would be very appreciated! :slight_smile:
//Robin
[php]<?php

$to = ‘[email protected]’;
$subject = ‘Fråga på Organisation.se’;

$name = $_POST[‘name’];
$email = $_POST[‘email’];
$topic = $_POST[‘topic’];
$message = $_POST[‘message’];

$body = <<<EMAIL

Hej $name ! Tack för din fråga på Organisation.se!
Vi kommer att svara på ditt meddelande snarast möjligt.

Här är din fråga angående $topic :

$message

med vänliga hälsningar Organisation.se

Obs svara inte på detta mejlet!
Om det inte var du som skickade denna frågan, bara ignorera den.

Till: $email
Från: Organisation.se

EMAIL;

$header = “From: $email”;

if($_POST){
if($name == ‘’ || $email == ‘’ || $message == ‘’){
$feedback = ‘OBS Fyll i alla rutorna!’;
}else{
mail($to, $subject, $body, $header);
$feedback = ‘Tack för ditt mail!’;
}

}

?>

[/php]

Some of the HTML here:

[code]





Kontakt:


<?php echo $feedback; ?>






  • *Namn:



  • *Email:



  • *ärende:

    Jobb
    verksamhet
    Skydd
    Framsteg
    Annat



  • *Meddelande:




                </div>
        </div><!-- END MiddleHolder ###-->[/code]

the document does end with .php instead if .html
if anyone thinks thats the problem…

[php][/php]
$to =$_POST[‘to’];
$subject =‘subject’;
$message =’

Untitled Document
m`brace technologies
'

$headers = “MIME-Version: 1.0” . “\r\n”;
$headers .= “Content-type:text/html;charset=iso-8859-1” . “\r\n”;

// More headers
$headers .= ‘From:’.$_POST[‘from’]."\r\n";

mail($to,$subject,$message,$headers);
echo “”;

This is php mail function. This will definitely work.Do revert to me if there is any problem. i’m there to help you
ahamed

Sponsor our Newsletter | Privacy Policy | Terms of Service