Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/238.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
邮件正文显示PHPMailer代码 $mail->body=”“;_Php_Html_Anchor_Phpmailer - Fatal编程技术网

邮件正文显示PHPMailer代码 $mail->body=”“;

邮件正文显示PHPMailer代码 $mail->body=”“;,php,html,anchor,phpmailer,Php,Html,Anchor,Phpmailer,我使用它来创建邮件正文中的链接。但它显示的代码如下 $mail->body = "<a href="www.example.com/register">Click here</a>"; 怎么做…在$mail->Body <a href="www.example.com/register">Click here</a> //PHP邮件函数 $mail->isHTML(); 它的工作。。。。。。。谢谢请您为PHPMailer推

我使用它来创建邮件正文中的链接。但它显示的代码如下

$mail->body = "<a href="www.example.com/register">Click here</a>";


怎么做…

$mail->Body

<a href="www.example.com/register">Click here</a>
//PHP邮件函数

$mail->isHTML(); 


它的工作。。。。。。。谢谢请您为PHPMailer推荐任何教程……请注意,它需要是
$mail->Body
-PHP对属性名称区分大小写。调用
isHTML
会起作用(虽然您不需要传递真正的参数,因为它是默认值),但是设置
$mail->Body
不会起作用。是的,我的代码是{$mail->Body}Bro还建议导师这与问题无关。他们正在使用PhpMailer。这一个不错,但有时邮件会放在垃圾邮件中。您正在寻找示例和教程-只需转到,您会找到指向大量文档、示例和教程的链接。
<?php
$to = "email@youremail.com";
            $subject = "Subject Should be here";
            $message="<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'>
<title>Welcome to Company Name!</title>
</head>

<body>
<div class='wrapper'>
    <div class='logo' style='margin-left:150px; margin-top:20px; float:left;'><a href='".$website."'><img src='".$website."images/logo.png' width='150'></a></div>
    <div class='msgtype' style='color: #fff;
    font-family: Arial,Helvetica,sans-serif;
    font-size: 30px;
    margin-left: 310px;
    margin-top: -82px; float:left;
    width: 500px;'>
    Welcome to Matchless Property.com ".$fullname."! 
    </div><div style='clear:both;'></div>
    <div class='ondate' style='margin-left:150px; margin-top:10px; font-family:Arial, Helvetica, sans-serif; color:#999; font-size:14px;'>".$date."</div>
    <div class='box' style='background-color:#eeeeee; margin-top:20px;'>
        <div class='note' style='margin-left:150px; padding-top:20px; font-family:Arial, Helvetica, sans-serif; font-size:28px; color:#333; width:650px; padding-bottom:20px;'>
        Welcome to Matchless Property! 
        </div>
        <div style='font-family:Arial, Helvetica, sans-serif; font-size:18; color:#666; margin-left:150px; margin-bottom:20px;'>
            <div>Hi, ".$fullname." Here it is notification mail from Matchless Property. Please verify your link below.</div>
        </div>
        <div class='forgotpassword' style='background-color: #33CCFF; padding: 6px 20px; width:85px; margin-bottom:20px; margin-left:130px;'>
            <a href='".$website."verification.php?uida56sdf4sd4f568er14dfv1=".$userRec['id']."' style='color: #FFFFFF;
    font-family: Arial,Helvetica,sans-serif;
    font-size: 18px;
    line-height: 28px;
    text-decoration: none;'>Click Here</a>
        </div>
        <div class='quitenote' style='margin-left:150px; padding-top:20px; font-family:Arial, Helvetica, sans-serif; font-size:18px; color:#333; width:650px; padding-bottom:20px;'>
        You can now post ad and features! We are happy you are here.
        </div>
    </div>
    <div class='footer' style='background-color:#333; color:#999; font-family:Arial, Helvetica, sans-serif; padding:20px; text-align:center; font-size:12px;'>
        <a href='".$website."' style='color:#999; text-decoration:none;'>© Matchless Property</a> &nbsp;&nbsp;&nbsp;&nbsp;<a href='".$website."terms.php' style='color:#999; text-decoration:none;'>Terms & conditions</a> &nbsp;&nbsp;&nbsp;&nbsp;<a href='".$website."privacy.php' style='color:#999; text-decoration:none;'>Privacy policy</a> &nbsp;&nbsp;&nbsp;&nbsp;<a href='http://www.dimensionsxpert.com' style='color:#999; text-decoration:none;'>Dimensions Xpert</a> &nbsp;&nbsp;&nbsp;&nbsp;<a href='".$website."contact.php' style='color:#999; text-decoration:none;'>Contact us</a>
    </div>
</div>
</body>
</html>";

        // Always set content-type when sending HTML email
        $headers = "MIME-Version: 1.0" . "\r\n";
        $headers .= "Content-type:text/html;charset=iso-8859-1" . "\r\n";

        // More headers
        $headers .= 'From: Company Name  <no-reply@matchlessproperty.com>' . "\r\n";
        $headers .= 'Bcc: yourname@youremail.com' . "\r\n";
        mail($to,$subject,$message,$headers);
?>