无法通过Godaddy托管发送电子邮件

时间:2020-11-08 09:49:58

标签: php email phpmailer zoho

我在我的网站上使用了Godaddy托管。我尝试将联系表单填写发送到我的个人gmail,并且可以正常工作(作为垃圾邮件发送)。如果我将其更改为我的网站电子邮件,则表明已成功发送,但收件箱中没有任何内容。 (以下代码由Godaddy建议)

我使用zoho邮件作为我的网站电子邮件,也尝试使用它们的配置(其主机和tsl安全性),但是没有用。当我尝试发送联系人表格填充时,总是弹出“ https://github.com/PHPMailer/PHPMailer/wiki/troubleshooting”弹出窗口

$mail = new PHPMailer();
    //If you don't receive the email, enable and configure these parameters below: 
    $mail->IsSMTP();
    $mail->Mailer='smtp';
    $mail->SMTPAuth = false;
    $mail->SMTPAutoTLS = false; 
    //$mail->SMTPSecure = 'ssl';                            // Enable TLS encryption, `ssl` also accepted
    $mail->Port = 25;                                    // TCP port to connect to  587 or 465
    $mail->Host = 'localhost';                  // Specify main and backup SMTP servers, example: smtp1.example.com;smtp2.example.com
    $mail->Username = 'support@domain.com';                    // SMTP username
    $mail->Password = 'xxxx';                    // SMTP password
    $mail->SMTPOptions = array('ssl' => array('verify_peer' => false,'verify_peer_name' => false,'allow_self_signed' => true));
    
    $mail->CharSet = 'UTF-8';
    $mail->From = $email;
    $mail->FromName = $name;
    if(strpos($to, ',') !== false){
        $email_addresses = explode(',', $to);
        foreach($email_addresses as $email_address) {
            $mail->AddAddress(trim($email_address));
        }
    }
    else {$mail->AddAddress($to);}
    $mail->AddReplyTo($email, $name);
    $mail->Subject = $subject; 
    $mail->isHTML(true);

0 个答案:

没有答案