【问题标题】:To send sms and e-mail using php in a web-app [closed]在网络应用程序中使用 php 发送短信和电子邮件 [关闭]
【发布时间】:2014-03-08 05:03:31
【问题描述】:

我正在开发一个网络应用程序,我需要向那些正在注册为新用户并通过其发送有关更新信息的人发送短信和邮件

【问题讨论】:

标签: php


【解决方案1】:

您可以使用 php 发送邮件以使用邮件功能以下是邮件示例:

<?php
     $to = "somebody@example.com, somebodyelse@example.com";
     $subject = "HTML email";

     $message = "
            <html>
               <head>
                   <title>HTML email</title>
               </head>
               <body>
                 <p>This email contains HTML Tags!</p>

               </body>
            </html>
            ";

     // Always set content-type when sending HTML email
     $headers = "MIME-Version: 1.0" . "\r\n";
     $headers .= "Content-type:text/html;charset=UTF-8" . "\r\n";

     // More headers
     $headers .= 'From: <webmaster@example.com>' . "\r\n";
     $headers .= 'Cc: myboss@example.com' . "\r\n";

     mail($to,$subject,$message,$headers);
?>

而发送短信需要购买短信网关。

【讨论】:

    【解决方案2】:

    要发送短信,您需要一个 getway
    要使用 php 发送电子邮件,请使用函数 mail()
    http://www.php.net/manual/pt_BR/function.mail.php 你可以找到所有文档

    【讨论】:

    • 最好使用不同的邮件库,例如梨。 PHP mail() 非常有限。
    • 当然,但这只是一个提示:)
    猜你喜欢
    • 1970-01-01
    • 2011-11-03
    • 2016-10-30
    • 1970-01-01
    • 1970-01-01
    • 2012-08-13
    • 1970-01-01
    • 2016-05-16
    • 2013-05-11
    相关资源
    最近更新 更多