Jump to content

cant work out basic $email_to


yoyo

Recommended Posts

Here is some code that works perfectly. I receive an email BUT i have tried using the same code struture just with different names and i get a error. Also i want to send to more than one person. How would i do that? Working code<?php // set up some basic configuration$email_to = 'jamiewa2003@gmail.com';$subject = 'Potential customer';// receive variables from step2.php$name = $_POST['name'];$phone = $_POST['phone'];$email_address = $_POST['email_address'];$reside = $_POST['reside'];$message = "Name: " . $name . "\n";$message .= "Phone Number: " . $phone . "\n";$message .= "Email: " . $email_address . "\n";$message .= "Reside: " . $reside . "\n";?><?php if ($dont_send == false){ if ( mail($email_to , $subject , $message ) ) { //echo "Email successfully sent to " . $email_to ; } else { //echo "Email failed to send"; }} else { //echo "Please Fill in your Email Address" ;}?>NOT working Parse error: parse error, unexpected T_VARIABLE in /homepages/25/d205275768/htdocs/php/oz/site/thankyou.php on line 11<?php $email_to = 'jamiewa2003@gmail.com';$subject = 'Potential customer Full Details';$title2 = $_POST['title2'];$firstname2 = $_POST['firstname2'];$surname = $_POST['surname'];$day = $_POST['day'];$month = $_POST['month']$year = $_POST['year']$licence = $_POST['licence']$state = $_POST['state']$lmonth = $_POST['lmonth']$lyear = $_POST['lyear'] //line 11$children = $_POST['children']$street_number = $_POST['street_number']$street2 = $_POST['street2'];$suburb = $_POST['suburb'];$astate = $_POST['astate'];$postcode = $_POST['postcode'];$residence = $_POST['residence'];$ret_board = $_POST['ret_board'];$tel_number = $_POST['tel_number'];$mobile = $_POST['mobile'];$emai_address = $_POST['email_address'];$message = "Title: " . $title2 . "\n";$message .= "First Name: " . $firstname2 . "\n";$message .= "Surname: " . $surname . "\n";$message .= "D.O.B: " . $day . ;$message .= ": " . $month . ;$message .= ": " . $year . "\n";$message .= "Licence: " . $licence . ;$message .= ": " . $state . "\n";$message .= "Expiry Month: " . $lmonth . "\n";$message .= "Expiry Year: " . $lyear . "\n";$message .= "Children: " . $children . "\n";$message .= "Address: " . $street_number . ;$message .= ": " . $street2 . "\n";$message .= "Suburb: " . $suburb . "\n";$message .= "State: " . $astate . "\n";$message .= "Postcode: " . $postcode . "\n";$message .= "Residence: " . $residence . ;$message .= "Rent they pay: " . $rent_board . "\n"$message .= "Home Number: " . $tel_number . "\n";$message .= "Mobile: " . $mobile . "\n";$message .= "Email Address: " . $email_address . "\n";?><?php if ($dont_send == false){ if ( mail($email_to , $subject , $message ) ) { //echo "Email successfully sent to " . $email_to ; } else { //echo "Email failed to send"; }} else { //echo "Please Fill in your Email Address" ;}?>once again if anyone could assist me with these problems i would be very greatful

Link to comment
Share on other sites

For the parse error, these lines:

$month = $_POST['month']$year = $_POST['year']$licence = $_POST['licence']$state = $_POST['state']$lmonth = $_POST['lmonth']$lyear = $_POST['lyear'] //line 11$children = $_POST['children']$street_number = $_POST['street_number']

all need to end with a semicolon. I'm not sure why it called out line 11, but all of them need semicolons at the end like the other lines. To send emails to more then one address, separate the addresses with commas. As far as changing the name causing the error, what name are you using that causes an error?

Link to comment
Share on other sites

Thanks for picking up that i left out the semicolons I couldnt get two emails to work This is what i have$email_to = 'jamiewa2003@gmail.com' , 'jamiewa2003@msn.com';and this is the error i get. Parse error: parse error, unexpected ',' in /homepages/25/d205275768/htdocs/php/oz/site/step3.php on line 4Thank you again

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...