相关疑难解决方法(0)

PHP邮件功能无法完成电子邮件的发送

<?php
    $name = $_POST['name'];
    $email = $_POST['email'];
    $message = $_POST['message'];
    $from = 'From: yoursite.com';
    $to = 'contact@yoursite.com';
    $subject = 'Customer Inquiry';
    $body = "From: $name\n E-Mail: $email\n Message:\n $message";

    if ($_POST['submit']) {
        if (mail ($to, $subject, $body, $from)) {
            echo '<p>Your message has been sent!</p>';
        } else {
            echo '<p>Something went wrong, go back and try again!</p>';
        }
    }
?>
Run Code Online (Sandbox Code Playgroud)

我试过创建一个简单的邮件表单.表单本身在我的index.html页面上,但提交单独的"谢谢你的提交"页面thankyou.php,其中嵌入了上面的PHP代码.代码提交完美,但从不发送电子邮件.请帮忙.

html php email

458
推荐指数
16
解决办法
32万
查看次数

Mac OS X 10.10 Yosemite Postfix SASL身份验证失败

我按照以下链接中描述的步骤设置我的mac发送电子邮件. http://www.anujgakhar.com/2011/12/09/using-macosx-lion-command-line-mail-with-gmail-as-smtp/

它在我的Mac OS X 10.9上运行良好.但是在我升级到OS X 10.10之后.mail.log显示以下错误.问题是什么?

Oct 19 00:28:22 paullam-macbook-pro.local postfix/smtp[30383]: 6B47B8AD4E8: SASL authentication failed; cannot authenticate to server smtp.gmail.com[74.125.68.109]: generic failure
Oct 19 00:28:24 paullam-macbook-pro.local postfix/smtp[30383]: 6B47B8AD4E8: to=<zzpaul@gmail.com>, relay=smtp.gmail.com[74.125.68.108]:587, delay=3.4, delays=0.01/0/3.4/0, dsn=4.7.0, status=deferred (SASL authentication failed; cannot authenticate to server smtp.gmail.com[74.125.68.108]: generic failure)
Run Code Online (Sandbox Code Playgroud)

email postfix-mta smtp sasl osx-yosemite

31
推荐指数
2
解决办法
2万
查看次数

标签 统计

email ×2

html ×1

osx-yosemite ×1

php ×1

postfix-mta ×1

sasl ×1

smtp ×1