Can anyone please help me as i am receiving the email from the email address is "linxinquiry@linxinternational.org" but i want that the from email address should be the one who is filling the webform, second in the email i am getting <b> <br> tags with the values. though i have mentioned mime.php in the php code.

Please help me

<?php
require_once "Mail.php";
require_once "Mail/mime.php";
include ('Net/SMTP.php');
	/* Subject and Email variables */
	$to = "linxinquiry@linxinternational.org";
    $emailSubject = 'Online Inquiry Form';

	//smtp variables
	
	$host = "ssl://smtp.gmail.com";
	$port = "465";
	$username = "linxinquiry@linxinternational.org";
	$password = "xxxxxxxxxx";
  
/* Gathering Data Variables */

	$enquiryField = $_POST['enquiry'];
	$nameField = $_POST['name'];
	$dobField = $_POST['dob'];
	$phoneField = $_POST['phone'];
	$mobileField = $_POST['mobile'];
	$emailField = $_POST['email'];
	$cityField = $_POST['city'];
	
	
	$body = <<<EOD
<b> Online Inquiry Form </b><br>
Enquiry For: $enquiryField <br>
Name: $nameField <br>
Date of Birth: $dobField <br>
Phone No: $phoneField <br>
Mobile No: $mobileField <br>
Email ID: $emailField <br>
City: $cityField <br>
EOD;
	

	//create and send
	$headers .= "Content-type: text/html\r\n"; 
	$headers = array ('From' => $emailField,'To' => $to,'Subject' => "$emailSubject");
	$param = array ('host' => $host,'port' => $port,'auth' => true,
	'username' => $username,'password' => $password, 'timeout' => 10000); 

	$smtp = Mail::factory('smtp', $param); 
	$mail = $smtp->send($to,$headers, $body); 


if (PEAR::isError($mail)) {
  echo("<p>" . $mail->getMessage() . "</p>");
 } else {
  echo("<p>$theResults</p>");
 }

?>

Recommended Answers

All 2 Replies

PHP is parsing <b> and <br> as plain text. You need to echo the tags for them to be parsed as php.

this is an example ive grabbed from one of my scripts

echo '<p>Author details updated.</p>';

as for the email. you have the email stored as the variable $to, so thats where its being sent to, so the script is doing what its being told

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.