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>
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 根据以下文字信息,做EA模型图
  • ¥15 删除虚拟显示器驱动 删除所有 Xorg 配置文件 删除显示器缓存文件 重启系统 可是依旧无法退出虚拟显示器
  • ¥15 vscode程序一直报同样的错,如何解决?
  • ¥15 关于使用unity中遇到的问题
  • ¥15 开放世界如何写线性关卡的用例(类似原神)
  • ¥15 关于并联谐振电磁感应加热
  • ¥60 请查询全国几个煤炭大省近十年的煤炭铁路及公路的货物周转量
  • ¥15 请帮我看看我这道c语言题到底漏了哪种情况吧!
  • ¥60 关机时蓝屏并显示KMODE_EXCEPTION_NOT_HANDLED,怎么修?
  • ¥66 如何制作支付宝扫码跳转到发红包界面