테스트 메일을 보낼 수 없기 때문에 cakephp에서 이메일을 디버깅하려고합니다. 그러나, 내가하는 모든 것은 저에게 빈 웹 페이지, 심지어 디버그를 제공합니다.cakephp에서 디버깅 전자 메일이 작동하지 않습니다.
C : 나는 이미 다음은 내 코드는 2로 디버그 모드를 설정 \ XAMPP \ : \ XAMPP \ htdocs를 \ NewFolder \ 응용 프로그램 \ 웹 루트 \ 응용 프로그램 \ controllersmailer_controller.php
<?php
class MailerController extends AppController {
var $name = 'Mailer';
//Not using a model
var $uses = '';
//The built in Cake Mailer
var $components = array('Email');
$this->Email->delivery = 'debug';
/**
* Send a text string as email body
*/
function sendSimpleMail() {
//$this->Email->to = '[email protected]';
$this->Email->to = '[email protected]';
$this->Email->subject = 'Cake test simple email';
$this->Email->replyTo = '[email protected]';
$this->Email->from = 'Cake Test Account <[email protected]>';
//Set the body of the mail as we send it.
//Note: the text can be an array, each element will appear as a
//seperate line in the message body.
if ($this->Email->send('Here is the body of the email')) {
$this->Session->setFlash('Simple email sent');
} else {
$this->Session->setFlash('Simple email not sent');
}
//$this->redirect('/');
$this->Email->delivery = 'debug';
}
}
?>
C 이메일 \ htdocs를 \ NewFolder \ 응용 프로그램 \ 웹 루트 이메일 \ 응용 프로그램 \ 전망 \ 레이아웃 \ \ default.ctp
<?php echo $this->Session->flash(); ?>
<?php echo $this->Session->flash('email'); ?>
C : \ XAMPP \ htdocs를 \ NewFolder \ 응용 프로그램 \ 웹 루트 \ 이메일 \ 응용 프로그램 \ 전망 \ 레이아웃 \ 메일 \ HTML \ default.ctp
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<body>
<?php echo $content_for_layout; ?>
<?php echo $this->Session->flash(); ?>
<?php echo $this->Session->flash('email'); ?>
</body>
</html>
C : 로컬이 응용 프로그램을 실행하는 경우 \ XAMPP \ htdocs를 \ NewFolder \ 응용 프로그램 \ 웹 루트 이메일 \ 응용 프로그램 \ 전망 \ 레이아웃 \ 이메일 \ 텍스트 \의 default.ctp
<?php echo $content_for_layout; ?>
gvLearner,이 줄은 무엇을합니까? $ email = new CakeEmail(); – Charmie
cakephp에 내장 된 기능입니까? – Charmie
및 포트는 항상 465입니까? – Charmie