- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
我是 PHP 的新手,正在使用联系页面上的基本模板“发送邮件”表单。单击“提交”按钮时,要求我将电子邮件发送到多个电子邮件地址。我四处搜寻并没有完全找到我需要的东西。我需要在下面的表格中添加什么代码才能将其发送到多个电子邮件地址?
<?php
$mail_to = 'daniel30293@gmail.com'; // specify your email here
// Assigning data from the $_POST array to variables
$name = $_POST['sender_name'];
$mail_from = $_POST['sender_email'];
$phone = $_POST['sender_phone'];
$web = $_POST['sender_web'];
$company = $_POST['sender_company'];
$addy = $_POST['sender_addy'];
$message = $_POST['sender_message'];
// Construct email subject
$subject = 'Web Prayer Request from ' . $name;
// Construct email body
$body_message = 'From: ' . $name . "\r\n";
$body_message .= 'E-mail: ' . $mail_from . "\r\n";
$body_message .= 'Phone: ' . $phone . "\r\n";
$body_message .= 'Prayer Request: ' . $message;
// Construct email headers
$headers = 'From: ' . $name . "\r\n";
$headers .= 'Reply-To: ' . $mail_from . "\r\n";
$mail_sent = mail($mail_to, $subject, $body_message, $headers);
if ($mail_sent == true){ ?>
<script language="javascript" type="text/javascript">
alert('Your prayer request has been submitted - thank you.');
window.location = 'prayer-request.php';
</script>
<?php } else { ?>
<script language="javascript" type="text/javascript">
alert('Message not sent. Please, notify the site administrator admin@bondofperfection.com');
window.location = 'prayer-request.php';
</script>
<?php
}
?>
非常感谢您的帮助。
最佳答案
你内爆了一系列的收件人:
$recipients = array('jack@gmail.com', 'jill@gmail.com');
mail(implode(',', $recipients), $submit, $message, $headers);
请参阅 PHP:邮件函数引用 - http://php.net/manual/en/function.mail.php
收件人,或邮件的收件人。
此字符串的格式必须符合 » RFC 2822。一些例子是:
user@example.com
user@example.com
, anotheruser@example.com
<user@example.com>
<user@example.com>
, 另一个用户 < anotheruser@example.com
>关于PHP Send-Mail 表单到多个电子邮件地址,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14541839/
我正在尝试从如下所示的变量中提取一些内容: v1 ","person 2 ") (该变量有数百个观察值) 我想最终创建第二个变量来提取他们的电子邮件以提供以下输出: v2 ","person 2 ")
当您添加 facebook 连接以允许 facebook 用户登录您的站点时,您可以取消用户名和电子邮件地址吗? 最佳答案 是的,您需要先提示他们“电子邮件”数据权限。 Facebook 也在很快改变
我们正在寻求建立一个专门用于商业/商业用途的新网站。我们只需要允许“企业”电子邮件地址注册。因此,使用 Gmail、Hotmail、Yahoo 等的用户无法使用这些电子邮件地址申请。 除了创建 gma
我想通过Identity内的Claim访问我的电子邮件地址 我尝试访问为: var email = User.Identity.GetClaimsByType("emailaddress").ToSt
我正在使用 Hammock 库和 C# 从以下帖子中的链接获取用户的基本配置文件和电子邮件地址 here . 我也关注了这些帖子 here和 here 然而,对于我来说,我无法获得 linkedin
我正在使用 Hammock 库和 C# 从以下帖子中的链接获取用户的基本配置文件和电子邮件地址 here . 我也关注了这些帖子 here和 here 然而,对于我来说,我无法获得 linkedin
我正在尝试制作一个应用程序,通过获取 json 编码数组来从 SQL 数据库获取数据。 它获取地址数据和其他类型的数据,然后将其传递给 Mapkit map View 元素和一些标签/ TextVie
当使用钥匙串(keychain)和证书助手从现有 CA 申请证书时,所有说明都说我应该单击“保存到磁盘”选项,并且不需要“CA 电子邮件地址”。 我看到的面板没有提供“保存到磁盘”选项,当我尝试在没有
我的问题不在于我无法将电子邮件保存到数据库中。任何人都可以做到。这是我的问题: 当用户在我的网站上创建帐户时,他们会获得 ID、用户、密码和电子邮件地址数据。对于密码,我对其进行哈希处理,这样如果有人
我想向非 ASCII 电子邮件地址发送电子邮件,但我不确定使用 JDK8 的推荐程序是什么。 我应该如何处理以下电子邮件地址? Dörte@example.com test@Sörensen.de D
我想阻止用户: 从第一个文本框复制粘贴到第二个 右键单击并使用上下文菜单将第一个文本框复制并粘贴到第二个文本框。 这是行不通的。 Confirm email page
我正在使用两个不同的 Git 存储库(即 github 和 stash),我想为每个存储库使用不同的电子邮件地址。我知道我可以使用 git config 但我不想每次创建新工作区时都必须记住这样做。所
类似于this question ,但不确定在这种情况下如何实现。 受信任的用户(不需要关心验证输入)正在将电子邮件地址键入/粘贴到文本字段中。在模糊事件中,我想查看文本并清理他输入的任何内容(通常是
我正在使用以下代码使用 VBA 发送电子邮件。但是,没有发送电子邮件......我认为这是由于 '.To = ' 代码行中有多个电子邮件地址。有没有办法调整代码以允许多个电子邮件地址? 我试过看 Ro
我正在尝试制作一个脚本,该脚本将在整个网页中搜索以@xyz.com 结尾的电子邮件地址。例如: $(document).ready(function() { $("body:contains(
我们正在使用Office 365,并且遇到了创建重复帐户的问题。这会导致在用户地址上添加数字(john.doe@c0mpany.onmicrosoft.com也将是john.doe5826@c0mpa
我的类型是用户:电子邮件和用户名。 电子邮件字段设置为字符串类型,并使用自定义分析器“exact_lower”: index.analysis.analyzer.exact_lower: type
这个问题已经有答案了: Delete a specific user from Firebase (6 个回答) 已关闭 3 年前。 我正在建立一个网站,其中某个“管理员”用户可以删除任何其他用户的帐
我已经完成 Facebook 登录,但我不知道如何获取电子邮件地址并以其他形式显示它 所以,这就是代码 private void nextActivity(Profile profile){
我有一个付费应用程序,安装后用户可以使用购买该应用程序的电子邮件地址进行注册。 我想知道这个电子邮件地址是否从Google Play购买了我的应用(验证),否则拒绝其注册。有什么办法(API)? 最佳
我是一名优秀的程序员,十分优秀!