Я пытаюсь отладить мой адрес электронной почты в cakephp, так как я не могу отправить тестовую почту. Тем не менее, все, что я делаю, дает мне просто пустую веб-страницу, даже отладочную. Я уже установлен режим отладки 2. Ниже приведены мои коды:отладка электронной почты не работает в cakephp
C: \ XAMPP \ HTDOCS \ NewFolder \ приложение \ Webroot \ электронная почта \ приложение \ 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: \ XAMPP \ HTDOCS \ NewFolder \ приложение \ Webroot \ электронная почта \ APP \ Views \ раскладок \ default.ctp
<?php echo $this->Session->flash(); ?>
<?php echo $this->Session->flash('email'); ?>
C: \ XAMPP \ HTDOCS \ NewFolder \ приложение \ Webroot \ почта \ приложение \ вид \ раскладок \ почта \ 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 \ приложение \ Webroot \ электронная почта \ приложения \ Views \ раскладок \ электронная почта \ текст \ default.ctp
<?php echo $content_for_layout; ?>
gvLearner, что делает эта строка: $ email = new CakeEmail(); – Charmie
Это встроенная функция в cakephp? – Charmie
и порт, это всегда 465? – Charmie