PHP mail problem... help

PHP mail problem... help

Post by Kim Krus » Tue, 19 Aug 2003 18:18:12


Hi,

I'm trying to send this form http://www.yqcomputer.com/ 's
posting to this:

<?php

//angiver variablerne
$recipient = " XXXX@XXXXX.COM ";
$subject = "Fra kontakt formular";
$subject=$_POST['subject'];

//indhold af form form
$fornavn=$_POST['fornavn'];
$efternavn=$_POST['efternavn'];
$fornavn=$_POST['fornavn'];
$email=$_POST['email'];
$vejognummer=$_POST['vejognummer'];
$by=$_POST['by'];
$postnummer=$_POST['postnummer'];
$telefonnummer=$_POST['telefonnummer'];
$kommentar=$_POST['kommentar'];

//mail() funktion som sender mailen. Mke :o)
mail($recipient,$subject,$email,$fornavn,$efternavn,$vejognummer,$postnummer
,$telefonnummer,$kommentar);

//afsted det g til takke siden
header("Location: tak_kontaktform.htm");
?>

which should send the form and redirect users to this page
http://www.yqcomputer.com/

but this is what I get:

Warning: mail() expects at most 5 parameters, 9 given in
/web/www.netmaleren.dk/www/sendkontaktform.php on line 20

Warning: Cannot modify header information - headers already sent by (output
started at /web/www.netmaleren.dk/www/sendkontaktform.php:20) in
/web/www.netmaleren.dk/www/sendkontaktform.php on line 23

I'm tired so any help would be appreciated.

Thanks
Kim
 
 
 

PHP mail problem... help

Post by Kim Krus » Tue, 19 Aug 2003 19:44:56

Nevermind... I got it to work.

Kim



mail($recipient,$subject,$email,$fornavn,$efternavn,$vejognummer,$postnummer
(output

 
 
 

PHP mail problem... help

Post by Joe Makowi » Tue, 19 Aug 2003 20:57:41


<snip>

I know you got it to work; for the benefit of those who are interested:

http://www.yqcomputer.com/

bool mail ( string to, string subject, string message [, string
additional_headers [, string additional_parameters]])

So to do this right, you'd have to concatenate a bunch of stuff into
one string before you sent the mail:

// Create the body of the e-mail
$body = "EMail: " . $email;
$body .= "\nFornavn: " . $fornavn;
$body .= "\nEfternavn" . $efternavn;
...
// Send the mail
mail($recipient, $subject, $body);

where the dot (.) is the PHP concatenation operator and \n inserts a
newline character.

--
Joe Makowiec can be reached at:
http://www.yqcomputer.com/
 
 
 

PHP mail problem... help

Post by Kim Krus » Tue, 19 Aug 2003 22:13:16

Hi Joe,

Very cool. This is my first site in php and I got quite confused after
looking at all the different ways of doing this. Your method for sending a
mail is very nice.

Thank you for replying

Kim
 
 
 

PHP mail problem... help

Post by Gary Whit » Wed, 20 Aug 2003 02:04:39

On Mon, 18 Aug 2003 15:13:16 +0200, "Kim Kruse"



If you'd like to learn a little more, see
http://www.yqcomputer.com/


Gary
 
 
 

PHP mail problem... help

Post by Kim Krus » Wed, 20 Aug 2003 03:07:04

I'm always interested in learning more... so thank you very much.

Kim





a
 
 
 

PHP mail problem... help

Post by Gary Whit » Wed, 20 Aug 2003 07:42:09

On Mon, 18 Aug 2003 20:07:04 +0200, "Kim Kruse"



You're welcome, Kim.


Gary