How to send data into mail use codeigniter
How to send data into mail use Codeigniter?
Email is incredibly necessary for web applications. When a user signs up, we force require to send them an email to verify their email address and let the user verify the subscription. We further use email to reset forgotten passwords, send invoices and letters to customers, etc. CodeIgniter performs it super simple for us to send emails from our application utilizing a type of option.
CodeIgniter becomes a completed-in email library that we can use when sending emails.
Example
$msgs ="IP ADDRESS ".$ipAddress."</br>\n\nArrivalDate: ".$arrivalDate."\nDays - ".$Days."\nAdults - ".$adults."</br>Childs - ". $childs."</br>Category - ".$Category."</br>Message - ".$tourmessage."</br></br>Name - ".$name."</br>Mobile No : ".$phone."</br>EmailID : ".$customerEmail."</br>Country -".$Country."</br>";
$message = '<html><body>';
$message .= '<table rules="all" style="border-color:#690000;" cellpadding="5">';
$message .= "<tr style='background: #f9ffa4;'><td><strong>IP ADDRESS :</strong> </td><td>" . strip_tags($ipAddress) . "</td></tr>";
$message .= "<tr><td><strong>Date of Arrival :</strong> </td><td>" . $arrivalDate . "</td></tr>";
$message .= "<tr><td><strong>Days:</strong> </td><td>" . $Days . "</td></tr>";
$message .= "<tr><td><strong>Adults :</strong> </td><td>" . $adults . "</td></tr>";
$message .= "<tr><td><strong>Childs :</strong> </td><td>" . $childs . "</td></tr>";
$message .= "<tr><td><strong>Category:</strong> </td><td>" . $Category . "</td></tr>";
$message .= "<tr><td><strong>Name :</strong> </td><td>" . strip_tags($name) . "</td></tr>";
$message .= "<tr><td><strong>Mobile No :</strong> </td><td>" . $phone . "</td></tr>";
$message .= "<tr><td><strong>Email ID :</strong> </td><td>" .$customerEmail . "</td></tr>";
$message .= "<tr><td><strong>Message :</strong> </td><td>" . $tourmessage . "</td></tr>";
$message .= "<tr><td><strong>Choose Package :</strong> </td><td>" . $PackageName . "</td></tr>";
$message .= "<tr><td><strong>Page Reference :</strong> </td><td>" . $site_reference . "</td></tr>";
$message .= "</table>";
$message .= "</body></html>";
//print_r($message);die;
$headers = "From: " . $customerEmail . "\r\n";
$headers .= "Reply-To: ". strip_tags($customerEmail) . "\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
$subject = "Enquiry for Tour Package";
$Replsubject = 'Thank you for sharing information';
mail("info@piyush.com", $subject, $message, $headers);
//mail("vikas@piyush.com", $subject, $msg, $headers);
$headers1 = "From: " . "TravelExpert <info@piyush.com>" . "\r\n";
$headers1 .= "Reply-To: ". strip_tags("TravelExpert <info@piyush.com>") . "\r\n";
$headers1 .= "MIME-Version: 1.0\r\n";
$headers1 .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
mail($customerEmail, $Replsubject, "Thank you for filling out your information!
We have received your message and appreciate you contacting Us for Customize Tour Package.
We will try to respond you as soon as possible, so our Travel Expert will get back to you within a few hours.\n\nHave a great day ahead!", $headers1);
No comments