내 컨트롤러 동작은 다음과 같습니다.Yii 문의 양식이 이메일을 보내지 않음
public function actionContact()
{
$model=new ContactForm;
if(isset($_POST['ContactForm']))
{
$model->attributes=$_POST['ContactForm'];
if($model->validate())
{
$headers="From: {$model->email}\r\nReply-To: {$model->email}";
mail(Yii::app()->params['adminEmail'],$model->subject,$model->body,$headers)`enter code here`;
Yii::app()->user->setFlash('contact','Thank you for contacting us. We will respond to you as soon as possible.');
$this->refresh();
}
}
$this->render('contact',array('model'=>$model));
}
데이터의 유효성을 검사하고 성공 메시지를 표시합니다. 하지만 이메일 isn; t는 내 adminEmail 주소로 전송됩니다.
감사합니다.
@Samuel Liew를 사용하고, 그리고 어떻게 도움이됩니까? – crafter
mail() 함수는 오류 메시지를 반환하지 않을 수 있습니다. 웹 서버 로그를보고 오류가보고되었는지 확인하십시오. – crafter