我似乎無法找到一個解決方案,在網站上。我想要做的是讓用戶點擊一個按鈕。然後,這將發送一封郵件給我或辦公室的某個人,然後郵件將包含登錄的用戶詳細信息。我正在發送郵件,但我不確定如何讓代碼向我發送用戶信息。這裏是我的代碼:發送登錄用戶的詳細信息到管理員按鈕單擊使用phpmailer
include 'contact/config.php';
require_once 'class.user.php';
$user_home = new USER();
if(!$user_home->is_logged_in())
{
$user_home->redirect('index.php');
}
$stmt = $user_home->runQuery("SELECT * FROM tbl_client_info WHERE UCODE=:uid");
$stmt->execute(array(":uid"=>$_SESSION['userSession']));
$row = $stmt->fetch(PDO::FETCH_ASSOC);
error_reporting (E_ALL^E_NOTICE);
$post = (!empty($_POST)) ? true : false;
if($post)
{
$name = $row['firstname'];
$email = $row['billingemail'];
$subject = "myDraadloze Package Contact Card";
$message = stripslashes($_POST['Please contact user regarding example']);
$error = '';
if(!$error)
{
$mail = mail(WEBMASTER_EMAIL, $subject, $message,
"From: ".$name." <".$email.">\r\n"
."Reply-To: ".$email."\r\n"
."X-Mailer: PHP/" . phpversion());
if($mail)
{
echo 'OK';
}
}
}
?>
任何幫助,將不勝感激。
謝謝
我建議閱讀PHP文檔,並使用PHPMailer標記此問題。 – Synchro