小编Wal*_*ale的帖子

PHPMAILER不发送错误并且不发送错误

我想让用户填写一份联系表格,然后发送到我的电子邮箱.但由于某种原因它不起作用.我只是得到一个没有错误消息的空白页面或任何文本和电子邮件也没有发送.

if (isset($_POST['submit']))
{
    include_once('class.phpmailer.php');

    $name = strip_tags($_POST['full_name']);
    $email = strip_tags ($_POST['email']);
    $msg = strip_tags ($_POST['description']);

    $subject = "Contact Form from DigitDevs Website";

    $mail = new PHPMailer();
    $mail->IsSMTP();
    $mail->CharSet = 'UTF-8';

    $mail->Host       = "mail.example.com"; // SMTP server example
    //$mail->SMTPDebug  = 1;                     // enables SMTP debug information (for testing)
    $mail->SMTPAuth   = true;                  // enable SMTP authentication
    $mail->Port       = 26;                    // set the SMTP port for the GMAIL server
    $mail->Username   = "info@example.com"; // SMTP account username example
    $mail->Password   = "password";        // SMTP …
Run Code Online (Sandbox Code Playgroud)

php smtp phpmailer

13
推荐指数
5
解决办法
7万
查看次数

标签 统计

php ×1

phpmailer ×1

smtp ×1