Please correct my PHP code?

  • Thread starter Thread starter slashed_velocity
  • Start date Start date
S

slashed_velocity

Guest
Hi, I keep getting
"Parse error: syntax error, unexpected $end in /data/htdocs/vhost/damiancreatives.com/subdomains/test/mailer.php on line 75"
from the following code..please help me correct it. Thanks!

<?php
if(isset($_POST['submit'])) {

$to = "[email protected]";
$subject = "Form Tutorial";
$name = $_POST['name'];
$birthdate = $_POST['birthdate'];
$myspace = $_POST['myspace'];
$email = $_POST['email'];
$phone = $_POST['phone'];

$body = "Name: " . $name . "\n";
$body = "Birth Date: " . $birthdate . "\n";
$body = "Myspace: " . $myspace . "\n";
$body = "Email: " . $email . "\n";
$body = "Phone: " . $phone . "\n";
$body = "Date Sent: " . $date . "\n\n";


//if(mail($recipients, $subject, $email_info, $mailheaders)) {
if ($to && $subject && $body){
if(socketmail($to, $subject, $body)) {
// Print a success for Flash to know the email is being sent
print "&success=true";
}
}


function socketmail($to, $subject, $message, $from) {
//$dnt=date("n/j/Y g:i:s A");
$dnt=date("r");
// $toArray format --> array("Name1" => "address1", "Name2" => "address2", ...)
ini_set(sendmail_from, "$from");

$connect = fsockopen ("relay.wavenetworks.com", "9025", $errno, $errstr, 30) or die("Could not talk to the sendmail server!");
$rcv = fgets($connect, 1024);

fputs($connect, "HELO {$_SERVER['SERVER_NAME']}\r\n");
$rcv = fgets($connect, 1024);


fputs($connect, "MAIL FROM:$from\r\n");
$rcv = fgets($connect, 1024);
fputs($connect, "RCPT TO:$to\r\n");
$rcv = fgets($connect, 1024);
fputs($connect, "DATA\r\n");
$rcv = fgets($connect, 1024);

fputs($connect, "Subject: $subject\r\n");
fputs($connect, "From: $from\r\n");
fputs($connect, "To: $to\r\n");
fputs($connect, "X-Sender: <$from>\r\n");
fputs($connect, "Return-Path: <$from>\r\n");
fputs($connect, "Errors-To: <$from>\r\n");
fputs($connect, "MIME-version: 1.0\r\n");
fputs($connect, "Date: $dnt\r\n");
fputs($connect, "X-Mailer: PHP\r\n");
fputs($connect, "X-Priority: 3\r\n");
fputs($connect, "Content-Type: text/plain; charset=iso-8859-1\r\n");
fputs($connect, "\r\n");
fputs($connect, stripslashes($message)." \r\n");

fputs($connect, ".\r\n");
$rcv = fgets($connect, 1024);
fputs($connect, "RSET\r\n");
$rcv = fgets($connect, 1024);

fputs ($connect, "QUIT\r\n");
$rcv = fgets ($connect, 1024);
fclose($connect);
ini_restore(sendmail_from);
}


?>
 
you just missed another closing tag for the if(isset($_POST['submit'])) {

just add another "}" before the ?>


http://www.joxtechnology.com
 
Back
Top