Getting Multiple errors from this php code

the mail() function

Moderators: macek, egami, gesf

weaverofwords
New php-forum User
New php-forum User
Posts: 2
Joined: Sun May 12, 2013 9:56 am

Getting Multiple errors from this php code

Postby weaverofwords » Sun May 12, 2013 10:00 am

I have tried several different variations of this code, and nothing seems to work. I am new to PHP and am trying to move away from generators and do everything myself.

I have also tried putting $fullmessage parameters all under one variable heading and this did not work either. I don't know where I'm going wrong. I've spent about 5 hours so far trying to get this thing right.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Untitled Document</title>
</head>

<body>
<?php

$subject="$subject";

$message="$message";

$fname="$fname";

$lname="$lname";

$address1="$address1";

$address2="$address2";

$city="$city";

$state="$state";

$zip="$zip";

$dayphone="$dayphone";

$eveningphone="$eveningphone";

$mail_from="$email";

$fullmessage="Name: " . $lname "," . $fname . "\n";
$fullmessage="Address: " . $address1 "\n" . $address2 "\n";
$fullmessage="City:" . $city . "\n";
$fullmessage="State: " . $state . "\n";
$fullmessage="Zip: " . $zip . "\n";
$fullmessage="Day Phone: " . $dayphone . "\n";
$fullmessage="Night Phone: " . $eveningphone . "\n";
$fullmessage="Email: " . $email_from . "\n";

$header="from: $lname, $fname <$mail_from>";

$to='*@yahoo.com';

$send_contact=mail($to,$subject,$fullmessage,$header);

?>
</body>
</html>

weaverofwords
New php-forum User
New php-forum User
Posts: 2
Joined: Sun May 12, 2013 9:56 am

Re: Getting Multiple errors from this php code

Postby weaverofwords » Sun May 12, 2013 10:02 am

here is the other way i have tried, with several variations

$fullmessage="Name: " $lname "," $fname \n
"Address: "$address1 \n $address2 \n
"City: "$city \n
"State: "$state \n
"Zip: "$zip \n
"Day Phone: "$dayphone \n
"Night Phone: "$eveningphone \n
"Email: "$email_from \n;


Return to “PHP coding => Mail”

Who is online

Users browsing this forum: No registered users and 0 guests