douzha6055 2015-09-07 17:31
浏览 32

电子邮件不会在带有标题的Wordpress中发送

I'm running a new WordPress website on LEMP on Debian 7, sendmail installed.

I have a custom theme installed which has contact form.

Contact form says email sent but email actually not delivered. I have tried to remove $headers from email, email delivered. Simple php mail function working properly. Same custom theme sending and delivering email through form at Shared host.

Here is part of custom form:

What is wrong with this? can anyone point me out what is wrong or how I can start sending emails?

if(!isset($hasError) && ($correct == true)) {

    $admin = get_bloginfo('admin_email');
    $portfolio = get_bloginfo('name');
    $portfolio_url = home_url();

    $emailTo = $admin;
    $pro = get_the_title();
    $subject = "You have an message for $pro";
    $body = "Hello,

You've received an message from ".$name.", for ".$pro." fun name.

Here are message details:
--------------------------------
Buyer Name: ".$name."
Email: ".$email."
Message: ".$message." ".$CurrencyCode."

Message: ".$message."

---------
".$portfolio."
".$portfolio_url;
    $headers = "From: ".$portfolio." <".$emailTo.">" . "
" . "Reply-To: " . $email;

    wp_mail($emailTo, $subject, $body, $headers);

    $emailSent = true;
}

Thank you!

  • 写回答

1条回答 默认 最新

  • doufen9815 2015-09-07 17:42
    关注

    wp_mail has an open bug related to the Reply-To header. Try removing that header only and check if the email is sent correctly. If that's the case, you will have to create a plugin to wrap it or just avoid setting the Reply-To header.

    评论

报告相同问题?

悬赏问题

  • ¥15 华为ensp模拟器中S5700交换机在配置过程中老是反复重启
  • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
  • ¥15 有了解d3和topogram.js库的吗?有偿请教
  • ¥100 任意维数的K均值聚类
  • ¥15 stamps做sbas-insar,时序沉降图怎么画
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
  • ¥15 关于#Java#的问题,如何解决?
  • ¥15 加热介质是液体,换热器壳侧导热系数和总的导热系数怎么算
  • ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计
  • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line