note 77441 added to ref.mail

From: Date: Wed, 29 Aug 2007 22:02:09 +0000
Subject: note 77441 added to ref.mail
Groups: php.notes 
Request: Send a blank email to php-notes+get-129889@lists.php.net to get a copy of this message
the mail is only sent to info@traveletto.com, not to the contact_email. What have i done wrong ? <?php require_once( GLOBAL_ROOT . 'DB/Database.class.php' ); require_once( SMARTY_CLASS ); require_once( GLOBAL_ROOT . '_smarty.php'); require_once( GLOBAL_ROOT . '_db_start.php'); $object_id = $_GET[ 'object_id' ]; $contact_info = $dbObj->query( 'SELECT object.name AS object_name, object_type.name AS object_type_name, contact_firstname, contact_lastname, contact_email, contact_phone_1, contact_phone_2 FROM object JOIN object_type ON object.object_type_id = object_type.object_type_id WHERE object_id = ' . $object_id . ';' ); $smarty->assign( 'contact_info', $contact_info ); /** * assign pagerelated info to fill in <title></title> */ $smarty->assign('title', 'Book now - Traveletto.com'); /** * no mail is sent by default */ $smarty->assign( 'mail_sent', false ); /** * send mail */ if( isset( $_GET[ 'send' ] )){ while ($row = mysql_fetch_assoc($contact_info)) { $tmp_str= $row['object_id']; } $strName = $_POST[ 'txtName' ]; $strEmail = $_POST[ 'txtEmail' ]; $strTelephone = $_POST[ 'txtTelephone' ]; $strSubject = 'Traveletto.com - Inquiry regarding object ' . $contact_info[ 'object_name' ]; // Fix $strLengtOfStay = $_POST[ 'lenght_of_stay' ]; $strNumberOfGuests = $_POST[ 'number_of_guests' ]; $strYear = $_POST[ 'year' ]; $strMonth = $_POST[ 'month' ]; $strDay = $_POST[ 'day' ]; // end of Fix $strMessage = $_POST[ 'areaMessage' ]; if($strName == ""){ echo("<b>Must enter a name</b>"); exit; } if($strEmail == "") { $strEmail = "none"; } if($_POST[ 'areaMessage' ] == ""){ echo("<b>Must enter a message</b>"); exit; } $strMessage = "Name: ".$strName."\r\n"; $strMessage .= "Email: ".$strEmail."\r\n"; $strMessage .= "Length of stay: ".$strLengtOfStay."\r\n"; $strMessage .= "Number of Guests: ".$strNumberOfGuests."\r\n"; $strMessage .= "Date: ".$strDay."-".$strMonth."-".$strYear."\r\n\r\n"; $strMessage .= $_POST[ 'areaMessage' ]; $strHeaders = "MIME-Version: 1.0\r\n"; $strHeaders .= "Content-type: text/html; charset=iso-8859-1\r\n"; $strHeaders .= "From: " . $strName . "<". $strEmail . ">\r\n"; $strHeaders .= "Reply-To:" . $contact_email; $strHeaders .= "Reply-To: info@traveletto.com"; $to_str=$contact_email. ' , info@traveletto.com '; if( mail( $to_str, $strSubject, $strMessage, $strHeaders ) ) { $smarty->assign( 'mail_sent', true ); } } $smarty->display('book_now.tpl'); require_once( GLOBAL_ROOT . '_db_end.php'); ?> ---- Server IP: 129.16.214.50 Probable Submitter: 213.89.161.112 ---- Manual Page -- http://www.php.net/manual/en/ref.mail.php Edit -- https://master.php.net/note/edit/77441 Del: integrated -- https://master.php.net/note/delete/77441/integrated Del: useless -- https://master.php.net/note/delete/77441/useless Del: bad code -- https://master.php.net/note/delete/77441/bad+code Del: spam -- https://master.php.net/note/delete/77441/spam Del: non-english -- https://master.php.net/note/delete/77441/non-english Del: in docs -- https://master.php.net/note/delete/77441/in+docs Del: other reasons-- https://master.php.net/note/delete/77441 Reject -- https://master.php.net/note/reject/77441 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#129889) next »