我遇到了注册按钮无法发送的问题。
这是主页上的代码(注册按钮所在的位置):
<div class="signup">
<form action="sendmail.php" method="post" name="frm-signup" id="frm-signup">
<div id="item-form">
<input class="email" type="text" value="Your e-mail address" onclick="value=''" size="20px" name="email" id="jf_email"/>
<input class="submit" type="button" name="submit" value="Sign up" size="95px" id="jf_submit"/>
</div>
<div style="position: relative;">
<div id="jf_error_email" style="display:none;">
<p class="hs_infor">
This isn't a valid email address
</p>
</div>
</div>
</form>
<p style="display: none;" id="thank_you">Thank you. We'll update you as soon as possible.</p>
</div>
基本上,当您在输入有效格式的电子邮件地址后单击注册按钮时,会出现以下消息(谢谢。我们会更新您等)。目前按钮根本不起作用。它不会将电子邮件发送回他们的电子邮件,也不会显示感谢信息。
这是 sendmail.php 的 php 代码:
<?php
$from = "ask@michaelfrieda2014.com";
if (isset($_REQUEST['email']) && $_REQUEST['email'] != '')
{
$email = $_REQUEST['email'];
sendMailSingup($from, $email);
sendMailSingup($from, "ask@michaelfrieda2014.com");
}
function sendMailSingup($from, $to)
{
include_once('phpmailer/class.phpmailer.php');
$mail = new PHPMailer();
$body = "Thank you. We'll update you as soon as possible.";
$mail->IsSendmail(); // telling the class to use SendMail transport
$mail->From = "$from";
$mail->FromName = "Frieda and Michael";
$mail->Subject = "Thank you!";
$mail->AltBody = "Thank you!"; // optional, comment out and test
$mail->MsgHTML($body);
$mail->AddAddress("$to", "");
//$mail->AddAttachment("images/phpmailer.gif"); // attachment
if(!$mail->Send()) {
echo "Mailer Error: " . $mail->ErrorInfo;
} else {
#echo "Message sent!";
echo 1;
}
}
在您输入电子邮件地址的那一刻,它们返回错误:
邮件程序错误:无法执行:/usr/sbin/sendmailMailer 错误:无法执行:/usr/sbin/sendmail
谢谢!