PHP邮件程序没有发送,没有错误返回

时间:2013-11-07 08:29:57

标签: php phpmailer

这是我的代码,尝试了几个解决方案,比如检查过程是否正确以及它是否也在我想要的地方。路径。我会很感激我做错了什么。提前致谢。到目前为止它输出$messsageForSender但仍未发送。

include('code/phpmailer/PHPMailerAutoload.php');
if($return_e == true){
            $todayis = date("l, F j, Y, g:i a") ;
            $subject = "Support Request";

                    $messageForSender = "$todayis [EST]
                        <br />
                        <p>
                        Hi $firstname $lastname,
                        <br /><br />
                        Thank you for your inquiry.
                        <br />
                        One of our experts will get in touch with you very soon.
                        <br />
                        </p>";

                        echo $messageForSender;
                        $mail = new PHPMailer();
                        $mail->IsMail();

                        $mail->AddAddress('test@gmail.com');
                        $mail->Subject = $subject;
                        $mail->IsHTML(true);
                        $mail->From=$markto;
                        $mail->FromName=$markto;
                        $mail->Body = $messageForSender;

                    if(!$mail->Send()){
                        echo "Error sending: " . $mail->ErrorInfo;;
                    }else{
                        echo '<h1>mail is sent</h1>';
                    }

0 个答案:

没有答案