2013-02-16 3 views
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()); 
    } 

?> 

답변

0

이 멀다는하지만, 난 당신이 설정 자신의 Gmail 계정을 가지고 같아요. 그렇지 않으면 [email protected]을 가장 할 수 없습니다.

관련 문제