PHP 메일 기능을 사용하여 전자 메일 주소를 입력하면 암호가있는 사용자에게 전자 메일을 보낼 수 있습니다. 전자 메일을 통해 암호를 전달할 때 보안이 좋지 않다고 생각하지만 나중에 초점을 맞출 수 있습니다. 지금은 기능이 필요합니다. 내 성공 메시지가 반환 될 때 코드가 작동하는 것처럼 보이지만 전자 메일이나 아이디어가 수신되지 않습니다. XAMPP 서버 솔루션 패키지의 일부로 Apache Server에서 호스팅되는 Joomla 3.0을 사용하고 있습니다. 나도 다른 포럼에서 이것을 보았지만 행운을 빕니다. (로컬 호스트가 문제를 일으키는 지 궁금합니다.)Joomla 3.0에서 PHP 메일 기능이 작동하지 않습니다.
양식 작업을위한 내 코드 사용자가) 자신의 이메일을 입력 한입니다
이<?php
if (isset($_POST['submit']))
{
mysql_connect('localhost','root','') or die("Could not connect to database");
mysql_select_db('joomla_lifestyle') or die("Could not select database");
$email = $_POST['email'];
$sql = mysql_query("SELECT * FROM users WHERE Email ='$email'");
$result = mysql_num_rows($sql);
if ($result == 1)
{
$rows = mysql_fetch_array($sql);
$password = $rows['Password'];
$email = $rows['Email'];
$subject = "Password Request";
$header = "from: [email protected]";
$body = "Your Password is " . $password;
mail($email, $subject, $header, $body);
$msg = "An Email Containing the Password has been Sent to you!";
header("Location:/Joomla-Lifestyle/index.php?option=com_content&view=article&id=9&msg=$msg");
} else
{
$msg = "User doesn't exist, please try again.";
header("Location:/Joomla-Lifestyle/index.php?option=com_content&view=article&id=9&msg=$msg");
}
}
?>
호기심에 사용자가 가입 한 후에 사용자 비밀번호를 보내기 위해 내장 된 새 사용자 이메일 기능을 사용하지 않는 이유가 있습니까? –
그래, 그 기능을 사용할 수 있지만 그 코드를 기반으로 등급이 매겨지고 있다는 것을 알고 있기 때문에 작업은 독창적이어야합니다. – user3266484