잘 작동하는 PHP 코드가 있습니다. 나는 user - A
이 (가) 요청한 관리자에게 전자 메일을 보내려고합니다. 전자 메일을 확인하면 user -
이 표시됩니다. 사용자 이름이 표시되지 않습니다.PHP - 이메일에 사용자 이름 보내기
PHP 코드 :
<?php
require 'PHPMailerAutoload.php';
$username = $_SESSION ["username"];
function leave_mail($user, $message){
//Some connection and credentials for the gmail
$username = $_SESSION ["username"];
$mail = new PHPMailer;
leave_mail($username, "Your message has been sent to the <b>admin.</b>");
leave_mail('[email protected]', 'This message is to notify that you have a <b>new leave request</b> from <i><b>USER - <?php echo $username;?></b></i>');
?>
이 도와주세요!
헤이 유효한 코드가 아닙니다! – Turtle
나는 이해하지 못했다!? –
당신은 이미 PHP에 연결되어 있습니다. – chris85