php原生发送邮件
Posted f4natasy
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了php原生发送邮件相关的知识,希望对你有一定的参考价值。
<?php
session_start();
$header="MIME-Version: 1.0".PHP_EOL;
$header.="From:[email protected]".PHP_EOL;
$header.="Content-Type:text/html;charset=utf-8".PHP_EOL;
$address=$_POST[‘email‘];
$subject=‘Thanks for shoping‘;
$message="<html>".$_POST[‘lname‘]." ".$_POST[‘fname‘].":<br/> Thanks for renting cars from Hertz-Uts,the
costs is"." ".$_POST[‘cost‘].".</br>Details are as follows:<br/>";
//echo $message;
$carArray = simplexml_load_file("carr.xml") or die("failed");
foreach($_SESSION[‘car‘] as $key=>$i) {
foreach($carArray->children() as $c){
if ($c->Model == $i){
$year = $c->ModelYear;
$m=$c->Mileage;
$type=$c->FuelType;
$seats=$c->Seats;
$des=$c->Description;
$price = $c->PricePerDay;
$brand = $c->Brand;
$model=$c->Model;
}
$title = $year."-".$brand."-".$i;
$img="pic/".$model.‘.jpg‘;
}
$tian=$_SESSION[‘day‘][$key];
$message= $message."model:$title</br>mileage:$m kms</br>fuel_type:$type</br>seats:$seats<br/>price_per_day:$price<br>
rent_days:$tian<br/>description:$des<br></html>";
}
$txt = wordwrap($message,70);
echo $txt;
mail($address,$subject,$txt,$header);
?>
以上是关于php原生发送邮件的主要内容,如果未能解决你的问题,请参考以下文章