欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  后端开发

暑假笔记2:PHPMail

程序员文章站 2022-06-15 22:31:12
...
在学习Luke Welling与L.Thomson的 《PHP and MySQL Web Development》的第四章时需要创建一个可以发送Email的HTML:

D:\PHPProj\PHPWeb\Class1\1.2\processfeedback.php

$name=addslashes(trim($_POST['name']));
    $email=addslashes(trim($_POST['email']));
    $feed=addslashes(trim($_POST['feedback']));

    $toaddress="532968708@qq.com";
    $subject="Feedback from web site";
    $mailcontent="Customer name :".$name."\n".
                "Customer email :".$email."\n".
                "Customer comments:\n".$feedback."\n";
    $fromaddress="From:myphp_test@sina.com";
    $issend=mail($toaddress,$subject,$mailcontent,$fromaddress);
    if($issend)
{
  echo'
sucessful
'
; }else { echo'
failed
'
; } ?> "en-US"
> "UTF-8"