duanliang1999 2016-04-13 21:03
浏览 66
已采纳

发送垃圾邮件的PHP邮件功能[关闭]

I have a free 000webhost account so I can't use php mailer or something like that. Normally whenever I use the php mail function it goes to my spam but now the emails aren't even appearing anywhere (I'm presuming that 000webhost's mail server is temporarily down). I want to be able to have it so the emails don't go to spam. Thanks for any help in advance.

  • 写回答

1条回答 默认 最新

  • dsgk40568 2016-04-13 21:21
    关注

    Make sure you have the correct header information, but the receiving server picks where to put the email. example: gmail.com just believes your url / server / email is spam.

    There can be a lot of reasons for that, make sure you do all the proper webmaster work on https://www.google.com/webmasters/tools/home?hl=en

    This will help with gmail at least.

    You can only do, so much even stackoverflow emails goto my spam folder and stack is huge.

    Just make sure you tell people who submit forms to check their spam folders.

      <?php
                $to = 'johndoe@gmail.com';                           
                $from = "emailaccount_youhave_setupon_server@yoruserver.com";
                $subject = 'Website: Account Activation';
                $message = '<!DOCTYPE html><html>
                                <head><meta charset="UTF-8"><title>Website: Message</title></head>
                                    <body style="margin:0px;">
                                        <div style="padding:10px;">
                                            Website: Account Activation
                                        </div>
                                        <div style="padding:24px; font-size:17px;">
                                            Hello '.$u.',<br><br>
                                            Click the link below to activate your account:<br><br>
                                            Click here to activate your account
                                        </div>
                                    </body></html>';
                $headers = "From: ".$from."
    ";
                $headers .= "MIME-Version: 1.0
    ";
                $headers .= "Content-type: text/html; charset=iso-8859-1
    ";
                if(mail($to, $subject, $message, $headers)){echo 'email sent';}
        ?>

    </div>
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度