【发布时间】:2017-10-24 05:36:14
【问题描述】:
尝试使用 html 表单和 php 引擎构建 群发短信(多个手机接收者)代码。
旁注:我的牧师每天向 300 多个订阅者发送一条短信(使用手机应用程序),但只有一些订阅者到达。有些人每月只收到一两个。在我收到一封之前,他经常每天给我发送 5 到 10 次。
我看到的类似问题的“答案”让我更加困惑。我是新手;我什至不完全理解提问的说明。
<!DOCTYPE php 5.3 PUBLIC >
<head>
<!---
// Double slash indicates comments
// This page url = http://edwardcnhistianchurch.edwardnc.org/Test-Kitchen/Mass_text/text_engine.php
// Form url = http://edwardcnhistianchurch.edwardnc.org/Test-Kitchen/Mass_text/text.html
--->
<Title>Text Engine</Title>
<src="http://edwardchristianchurch.edwardnc.org/Test-Kitchen/Mass_Text/default.config.php">
</head>
<?php
// Define variables
$EmailFrom = "2524025303@mms.uscc.net" ;
// Add additional addresses in next line 'enclosed' and separated by commas
$EmailTo = "2529169282@vtext.com,2524025305@mms.uscc.net, ";
$Subject = Trim(stripslashes($_POST['Subject']));
$Body = ($_POST['smsMessage']);
$From = Trim(stripslashes($_POST['From']));
$Password = Trim(stripslashes($_POST['Password']));
// <!--- SMTP server = yew.arvixe.com ; domain = mail.edwardnc.org --->;
$host = "yew.arvixe.com";
$username = "2524025305@edwardnc.org";
$SMTP_authentication = "Normal_Password";
$password = $Password;
$port = "587";
// SMTP Configuration
// enable SMTP authentication
$mail->SMTPAuth = true;
$mail->Host = $host;
$mail->Username = $username;
$mail->Password = $password;
$mail->Port = $port;
$mail->From = $EmailFrom;
$additional_parameters = '$mail' ;
// SendEmail
// $success = mail($EmailTo, $Subject, $Body, "From: <no_reply@edwardnc.org>" );
// Next line requires STMP_Authentication, line above works on another page;
$success = mail($EmailTo, $Subject, $Body, "From: $EmailFrom" );
// Indicate success or failure
if ($success){
print "Message was sent to multiple recipients" ;
}
else {
print "OOPS! Something went wrong";
}
?>
</src="http://edwardchristianchurch.edwardnc.org/Test-Kitchen/Mass_Text/default.config.php">"
警告:mail() [function.mail]:SMTP 服务器响应:530 SMTP >需要身份验证。在 E:\HostingSpaces\eeeaim\edwardchristianchurch.org\wwwroot\Test-Kitchen\Mass_Text\text_engine.php 第 41 行 哎呀!出了点问题
告诉我如何更正第 41 行。或者在其他地方添加什么。 请不要告诉我使用 phpmailer,除非您确切地(以非技术术语)告诉我要更改哪些行以及如何更改,因为它会导致错误 404,并且没有关于缺少哪个文件/目录的信息。
注意:发件人是不变的。收件人是不变的(订阅者列表)
【问题讨论】:
-
您是否输入了正确的 smtp 详细信息,例如主机名、密码、端口号?
-
上述错误主要是凭据错误造成的。你确定密码和用户名是正确的。此外,如果在共享主机上,有时您的主机提供商可能不允许外部 smtp 连接。
-
它可能是因为端口。使用端口 587。
-
谢谢您的cmets。它们比复杂的“答案”更有帮助。更改为 587 无效。凭据已被重新检查多次。