douaonong7807 2019-07-27 07:41
浏览 67

Php邮件发送邮件但未收到

I am using this code. It gives me reply mail sent successfully but the mail not received at the address?

function sendmail($to,$subject,$message) {

        $mail = new PHPMailer; // call the class
        $mail->IsSMTP();
        $mail->Host = 'smtp.pepipost.com'; //Hostname of the mail server
        $mail->Port = 587; //Port of the SMTP like to be 25, 80, 465 or 587
        $mail->SMTPAuth = true; //Whether to use SMTP authentication
        $mail->Username = 'mahadev'; //Username for SMTP authentication any valid email created in your domain
        $mail->Password = 'Arena@123'; //Password for SMTP authentication
        $mail->AddReplyTo("info@pepisandbox.com", "Sudam Wanve"); //reply-to address
        $mail->SetFrom("info@pepisandbox.com", "Sudam SMTP Mailer"); //From address of the mail
        // put your while loop here like below,
        $mail->Subject = "Test MAil"; //Subject od your mail
        $mail->AddAddress("imranq031@gmail.com"); //To address who will receive this email
        $mail->MsgHTML("<b>Hi, your first SMTP mail has been received. Great Job!.. <br/><br/>by <a href='http://asif18.com'>Asif18</a></b>"); //Put your body of the message you can place html code here
       //Attach a file here if any or comment this line,
        $send = $mail->Send(); //Send the mails
        echo $send;
        if($send){
            echo '<center><h3 style="color:#009933;">Mail sent successfully</h3></center>';
        }
        else{
            echo '<center><h3 style="color:#FF3300;">Mail error: </h3></center>'.$mail->ErrorInfo;
        }
}
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 使用EMD去噪处理RML2016数据集时候的原理
    • ¥15 神经网络预测均方误差很小 但是图像上看着差别太大
    • ¥15 Oracle中如何从clob类型截取特定字符串后面的字符
    • ¥15 想通过pywinauto自动电机应用程序按钮,但是找不到应用程序按钮信息
    • ¥15 如何在炒股软件中,爬到我想看的日k线
    • ¥15 seatunnel 怎么配置Elasticsearch
    • ¥15 PSCAD安装问题 ERROR: Visual Studio 2013, 2015, 2017 or 2019 is not found in the system.
    • ¥15 (标签-MATLAB|关键词-多址)
    • ¥15 关于#MATLAB#的问题,如何解决?(相关搜索:信噪比,系统容量)
    • ¥500 52810做蓝牙接受端