2011-12-04 43 views

回答

0

你可以在你的控制器配置格式:

//Send as 'html', 'text' or 'both' (default is 'text') 
$this->Email->sendAs = 'both'; // because we like to send pretty mail 
// more code here 
$this->Email->send(); 

如果這是由服務器此舉引發,它可能是你缺少一個文件,而不是一行代碼。在這種情況下,請確保您爲這兩種類型的電子郵件都設置了佈局。下面是該文件結構的檢查:

app/views/layouts/email/ 
    html/ 
     default.ctp 
    text/ 
     default.ctp 

更多從食譜: http://book.cakephp.org/view/1286/Sending-a-basic-message

相關問題