1
배 메일을 설치했는데 메일을 보내려 할 때 다음 오류가 표시됩니다. 어떤 질문없이 웹을 검색했는데 어떤 일이 발생했는지 알 수 있습니까? 안녕하세요, 배 메일을 설치하고 메일을 보내려고 할 때 다음 오류가 표시됩니다. 어떤 질문없이 웹을 검색했는데 어떤 일이 발생했는지 알 수 있습니까?배 메일, 보낸 사람을 오류로 설정할 수 없습니다.
unable to set sender to [[email protected]]
코드 :
<?php
// Include the Mail package
require "Mail.php";
// Identify the sender, recipient, mail subject, and body
$sender = "[email protected]";
$recipient = "[email protected]";
$subject = "Thank you for your email!";
$body = "I'll get back to you as soon as I can!";
// Identify the mail server, username, password, and port
$server = "ssl://smtp.gmail.com";
$username = "[email protected]";
$password = "supersecret";
$port = "465";
// Set up the mail headers
$headers = array(
"From" => $sender,
"To" => $recipient,
"Subject" => $subject
);
// Configure the mailer mechanism
$smtp = Mail::factory("smtp",
array(
"host" => $server,
"username" => $username,
"password" => $password,
"auth" => true,
"port" => 465
)
);
// Send the message
$mail = $smtp->send($recipient, $headers, $body);
if (PEAR::isError($mail)) {
echo ($mail->getMessage());
}
?>