我正在制作一个表单,当用户输入他们的电子邮件帐户并单击发送时,一封电子邮件将发送到他们的电子邮件帐户。
我已经解决了一切。只是它不会将电子邮件发送到我的帐户。有人有想法么?是否有我遗漏的配置或其他什么?
这是我的控制器的示例:
public function retrieveemailAction(){
$users = new Users();
$email = $_POST['email'];
$view = Zend_Registry::get('view');
if($users->checkEmail($_POST['email'])) {
// The Subject
$subject = "Email Test";
// The message
$message = "this is a test";
// Send email
// Returns TRUE if the mail was successfully accepted for delivery, FALSE otherwise.
// Use if command to display email message status
if(mail($email, $subject, $message, $headers)) {
$view->operation = 'true';
}
} else {
$view->operation = 'false';
}
$view->render('retrieve.tpl');
}