Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

problems in sending emails

Status
Not open for further replies.

misslois74

Programmer
Sep 27, 2008
63
PH
the page im currently working on has the facility to send email now my problem is my script has html tags in which when i send it the email its not displaying the desired format:

here is the sample output:

XXX Date of Registration: March 19, 2009 02:39 AM Name of Company: Company A Product/Service Category: Food and Beverage Contact Person: Mr A Designation: President Address: XXX Landline phone: 6454356 Email: a@yahoo.com No/s. of Booth Reserved: 1

here is the code i have:

Code:
$to = "xxx@mail.com";
								$date = date("F d, Y h:i A");
								$subject  = "Trade Exhibitor Application Form Details";
								$headers  = "MIME-Version: 1.0;\n";
								$headers .= "Content-type: text/html; charset=us-ascii;\n";
								
								/* additional headers */
								//$headers .= "To: webmaster <webmaster@somedomain.com>;\n";
								$headers .= "From: $email;\n";
								$Msg = "Application Form Details\n";
								$Msg .= "Date of Registration:          $date\n";
								$Msg .= "Name of Company:      			$name_company\n";
								$Msg .= "Product/Service Category:		$service_cat\n";
								$Msg .= "Contact Person:				$contact_person\n";
								$Msg .= "Designation:					$designation\n";
								$Msg .= "Address:						$address<br>";
								$Msg .= "Landline phone:				$landline_phone\n";
								
							if(isset($_POST['mobile_num']) && strlen($_POST['mobile_num']) != 0)
							{
								$Msg .= "Mobile number:					$mobile_num\n";
							}
							if(isset($_POST['faxnum']) && strlen($_POST['faxnum']) != 0)
							{
								$Msg .= "Fax Number:    				$faxnum\n";
							}
							if(isset($_POST['website']) && strlen($_POST['website']) != 0)
							{
								$Msg .= "Website:        				$mobile\n";
							}
								$Msg .= "\n Email:             			    $email\n";
								$Msg .= "\n No/s. of Booth Reserved:		$num_booth\n";
									
								mail($to, $subject, $Msg, $headers); 
																
								header("location: exhibitor_confirmation.php");

what i want to do is to generate an output which displays one line of information after the other....
hope anybody could help me with this...
thanks in advance...

 
assuming you don't want to forward the user to the exhibitor_confirmation.php page why not just add an echo after mail()?

Code:
echo nl2br($Msg);
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top