2011-07-05 5 views
0

이것은 단순한 것이지만 지금은 혼란 스러울 수 있습니다. 나는 기본적으로 previouse 프로젝트를 위해 만든 동일한 프레임 작업을 사용하고 스킨을 변경합니다.php - smtp pear Mail.php

내가 이메일 기능을 테스트하기 위해 시도했지만 작동하지 못했다,이 오류 : 그것은 메신저 여기에 허용되지 않는 것 같아 몇 가지 이유

Warning: require_once() [function.require-once]: open_basedir restriction in effect. File(../../../../php/Mail.php) is not within the allowed path(s): (/home/amatoita:/usr/lib/php:/usr/local/lib/php:/tmp)

??? 내가 잘못 가고 어디

Failed opening required 'Mail/mimePart.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/amatoita/php/Mail/mime.php

사람이 볼 수

그래서 나는 다음과 같은 오류가 발생했습니다

/usr/lib/php/Mail.php

/home/amatoita/php/Mail.php

/usr/local/lib/php/Mail.php

를 시도?

답변

0

include_path에 나열된 디렉토리 중 하나에 해당 패키지가 설치되어 있어야합니다. 그 말 (대부분), 당신이 원하는 것 :

/home/amatoita/php/Mail/mimepart.php 
2

나는 PEAR가에서 방향을 설치에 따라이 문제를 해결할 수 있었다에서 mimePart.php

/home/amatoita/php/Mail.php 

하고 있습니다 Mark's Tech Stuff blog.

제 문제는 배나무의 메일 모듈이 표준 Fedora 설치에 포함되어 있지 않다는 것입니다.

그런 다음 일부 코드 from the PEAR site을 사용했습니다.

<?php 

include 'Mail.php'; 
include 'Mail/mime.php' ; 

$text = 'Text version of email'; 
$html = '<html><body>HTML version of email</body></html>'; 
$file = '/home/richard/example.php'; 
$crlf = "\n"; 
$hdrs = array(
      'From' => '[email protected]', 
      'Subject' => 'Test mime message' 
     ); 

$mime = new Mail_mime(array('eol' => $crlf)); 

$mime->setTXTBody($text); 
$mime->setHTMLBody($html); 
$mime->addAttachment($file, 'text/plain'); 

$body = $mime->get(); 
$hdrs = $mime->headers($hdrs); 

$mail =& Mail::factory('mail'); 
$mail->send('[email protected]', $hdrs, $body); 

?> 

이제 내 이메일이 HTML로 전송됩니다. 희망은 당신을 도와줍니다.

관련 문제