第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

我沒(méi)有收到郵件

我沒(méi)有收到郵件

慕蓋茨4494581 2023-12-04 10:34:45
$to = 'someone.com';$firstname = $_POST["fname"];$lastname = $_POST["fname"];$subject= $_POST["subject"];$email= $_POST["email"];$text= $_POST["message"];$headers = 'MIME-Version: 1.0' . "\r\n";$headers .= "From: " . $email . "\r\n"; // Sender's E-mail$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";這是我的 php 頁(yè)面的代碼。你能讓我知道我的代碼有什么問(wèn)題嗎?感謝您的幫助if (mail($to,$subject,$text,$headers)){  echo "Check Email please";} else{    echo 'failed';}
查看完整描述

1 回答

?
胡說(shuō)叔叔

TA貢獻(xiàn)1804條經(jīng)驗(yàn) 獲得超8個(gè)贊

請(qǐng)確保您在頂部添加 Phpmailer 類(lèi)。


這是一個(gè)正常工作的郵件程序文件,將您的憑據(jù)放在這里并發(fā)送電子郵件。


<!DOCTYPE html>

<html>

<head>

    <title>Php Mailer</title>

    <link rel="stylesheet" type="text/css" href="bootstrap.min.css">

</head>

<body>

        <?php 

    // require 'PHPMailerAutoload.php';


        require("PHPMailer-master/src/PHPMailer.php");

        require("PHPMailer-master/src/SMTP.php");

        require("PHPMailer-master/src/Exception.php");



        $mail = new PHPMailer\PHPMailer\PHPMailer();

        $SendMailTo = "jonipk28@gmail.com";


        $mail->SMTPDebug = 0;                       


        $mail->isSMTP();                                      // Set mailer to use SMTP

        $mail->Host = 'smtp.gmail.com;';  // Specify main and backup SMTP servers

        $mail->SMTPAuth = true;                               // Enable SMTP authentication

        $mail->Username = "your_user_name_or_email@gmail.com";                 // SMTP username

        $mail->Password = "your_user_Password";                           // SMTP password

        // $mail->SMTPSecure = 'tls';                            // Enable TLS encryption, `ssl` also accepted

        $mail->Port = 587;                                    // TCP port to connect to


        $mail->setFrom("your_user_name_or_email@gmail.com");

        $mail->addAddress($SendMailTo);     // Add a recipient             // Name is optional

        $mail->addReplyTo("your_user_name_or_email@gmail.com");


        // $mail->addAttachment('/var/tmp/file.tar.gz');         // Add attachments

        // $mail->addAttachment('/tmp/image.jpg', 'new.jpg');    // Optional name

        $mail->isHTML(true);                                  // Set email format to HTML


        ///send custom code in email

        $code = 242343;

        $mail->Subject = 'TeachMe verification email';

        $mail->Body    = 'Hi <br><br> <b>Thanks for registeration,Your verification code is </b>'.$code;

        $mail->AltBody = 'This is the body in plain text for non-HTML mail clients';


        if(!$mail->send()) {

            echo 'Message could not be sent.';

            echo 'Mailer Error: ' . $mail->ErrorInfo;

        } else {

            echo 'Message has been sent';

        }

    ?>

</body>

</html>


查看完整回答
反對(duì) 回復(fù) 2023-12-04
  • 1 回答
  • 0 關(guān)注
  • 123 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢(xún)優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)