PHP中的Echo或Print after= while($apa=mysql\u fetch\u数组($query)){ $username=print($apa['username']); $pass=打印(md5(md5($apa['password'])); 需要“../phpmailer/phpmailerautoad.php”; 需要“../phpmailer/class.phpmailer.php”; $mail=新的PHPMailer; //$mail->SMTPDebug=3;//启用详细调试输出 $mail->isSMTP();//设置邮件程序以使用SMTP $mail->Host='mail.RoyaleEducation.web.id';//指定主SMTP服务器和备份SMTP服务器 $mail->SMTPAuth=true;//启用SMTP身份验证 $mail->Username='xxxxxx';//SMTP用户名 $mail->Password='xxxxxx';//SMTP密码 $mail->SMTPSecure='ssl';//启用TLS加密,也接受'ssl' $mail->Port=465;//要连接的TCP端口 $mail->setFrom($email,$name); $mail->addAddress($email);//添加收件人 $mail->addReplyTo($email); $mail->isHTML(true);//将电子邮件格式设置为HTML> $mail->msgHTML( “您的数据 username=“.$username.” password=“.$password” );

PHP中的Echo或Print after= while($apa=mysql\u fetch\u数组($query)){ $username=print($apa['username']); $pass=打印(md5(md5($apa['password'])); 需要“../phpmailer/phpmailerautoad.php”; 需要“../phpmailer/class.phpmailer.php”; $mail=新的PHPMailer; //$mail->SMTPDebug=3;//启用详细调试输出 $mail->isSMTP();//设置邮件程序以使用SMTP $mail->Host='mail.RoyaleEducation.web.id';//指定主SMTP服务器和备份SMTP服务器 $mail->SMTPAuth=true;//启用SMTP身份验证 $mail->Username='xxxxxx';//SMTP用户名 $mail->Password='xxxxxx';//SMTP密码 $mail->SMTPSecure='ssl';//启用TLS加密,也接受'ssl' $mail->Port=465;//要连接的TCP端口 $mail->setFrom($email,$name); $mail->addAddress($email);//添加收件人 $mail->addReplyTo($email); $mail->isHTML(true);//将电子邮件格式设置为HTML> $mail->msgHTML( “您的数据 username=“.$username.” password=“.$password” );,php,phpmailer,Php,Phpmailer,$username和$password将不会出现。。 我在$username和$password之后打印是否有误?? 或者还有另一种方法可以在phpmailer中打印出值??因为如果我在$mail->msgHTML中键入或echo,它的获取错误是如果使用函数,输出上显示的参数和print总是返回1,因此不能用于赋值 如果您对$mail->msgHTML功能有问题,可以使用$mail->Body如下: while ($apa = mysql_fetch_array($query)){ $u

$username$password将不会出现。。 我在$username$password之后打印是否有误?? 或者还有另一种方法可以在phpmailer中打印出值??因为如果我在$mail->msgHTML中键入echo,它的获取错误是如果使用函数,输出上显示的参数和
print
总是返回1,因此不能用于赋值

如果您对
$mail->msgHTML
功能有问题,可以使用
$mail->Body
如下:

while ($apa = mysql_fetch_array($query)){
    $username = print($apa['username']);
    $pass = print(md5(md5($apa['password'])));

     require '../phpmailer/PHPMailerAutoload.php';
        require '../phpmailer/class.phpmailer.php';

        $mail = new PHPMailer;
        //$mail->SMTPDebug = 3;                               // Enable verbose debug output

        $mail->isSMTP();                                      // Set mailer to use SMTP
            $mail->Host = 'mail.royaleducation.web.id';  // Specify main and backup SMTP servers
            $mail->SMTPAuth = true;                               // Enable SMTP authentication
            $mail->Username = 'xxxxxx';                 // SMTP username
            $mail->Password = 'xxxxxx';                           // SMTP password
            $mail->SMTPSecure = 'ssl';                            // Enable TLS encryption, `ssl` also accepted
            $mail->Port = 465;                                    // TCP port to connect to

        $mail->setFrom($email,$name);
        $mail->addAddress($email);     // Add a recipient
        $mail->addReplyTo($email);
        $mail->isHTML(true);                                    // Set email format to HTML>
        $mail->msgHTML(

            "<center><h1>Your data</h1></center><br><br>
            username =".$username."<br>
            password =".$password



        );
while($apa=mysql\u fetch\u数组($query)){
$username=$apa['username'];
$pass=md5(md5($apa['password']);
需要“../phpmailer/phpmailerautoad.php”;
需要“../phpmailer/class.phpmailer.php”;
$mail=新的PHPMailer;
//$mail->SMTPDebug=3;//启用详细调试输出
$mail->isSMTP();//设置邮件程序以使用SMTP
$mail->Host='mail.RoyaleEducation.web.id';//指定主SMTP服务器和备份SMTP服务器
$mail->SMTPAuth=true;//启用SMTP身份验证
$mail->Username='idxxxx';//SMTP用户名
$mail->Password='xxxxx';//SMTP密码
$mail->SMTPSecure='ssl';//启用TLS加密,也接受'ssl'
$mail->Port=465;//要连接的TCP端口
$mail->setFrom($email,$name);
$mail->addAddress($email);//添加收件人
$mail->addReplyTo($email);
$mail->isHTML(true);//将电子邮件格式设置为HTML>
$mail->Body=“您的数据”

用户名=“.$username.”
密码=“.$password;
所以我不能使用print或echo after=?如果使用print,您的变量始终是1。yaaa我在结果中得到了1。那么我如何在$mail->msgHTML???中回显变量?而不是
$mail->msgHTML()
使用
$mail->Body=
$mail->msgHTML($mail->Body=”“);如果输入这样的内容,它就会出错。你不是真的在电子邮件中通过明文发送用户名和密码,是吗?当然,密码是double-
md5
'd,但是
md5
也坏了。你为什么要这样做呢?md5没有坏,我把它翻了一倍。我想准确地测试一下,但如果我忘了密码,我必须重新测试从数据库中删除用户名和密码,然后再次发送到我的电子邮件。问题是,我获得了用户名和密码的值,但它不会出现在我的电子邮件中。
md5
在安全性方面非常糟糕。你不应该在新项目中使用它,而应该将旧项目从中移出。即使你做了两次,它仍然是安全的一个坏的算法。你也不应该通过电子邮件发送你的用户凭据。如果他们需要访问他们的帐户,他们应该能够访问,而不仅仅是让人将其发送给他们。好的,我稍后会更改它。但是如何回显值。。??
while ($apa = mysql_fetch_array($query)){
    $username = $apa['username'];
    $pass = md5(md5($apa['password']));

     require '../phpmailer/PHPMailerAutoload.php';
        require '../phpmailer/class.phpmailer.php';

        $mail = new PHPMailer;
        //$mail->SMTPDebug = 3;                               // Enable verbose debug output

        $mail->isSMTP();                                      // Set mailer to use SMTP
            $mail->Host = 'mail.royaleducation.web.id';  // Specify main and backup SMTP servers
            $mail->SMTPAuth = true;                               // Enable SMTP authentication
            $mail->Username = 'idxxxx';                 // SMTP username
            $mail->Password = 'xxxxx';                           // SMTP password
            $mail->SMTPSecure = 'ssl';                            // Enable TLS encryption, `ssl` also accepted
            $mail->Port = 465;                                    // TCP port to connect to

        $mail->setFrom($email,$name);
        $mail->addAddress($email);     // Add a recipient
        $mail->addReplyTo($email);
        $mail->isHTML(true);                                    // Set email format to HTML>
        $mail->Body ="<center><h1>Your data</h1></center><br><br>username =".$username."<br>password =".$password;