hello good guys
how do i change the contact form in a new app
so the response will come to my email?
how do i do that?
i try to put my email in the sitecontroler where it says ‘adminmail’
but its not go well
help plz?
hello good guys
how do i change the contact form in a new app
so the response will come to my email?
how do i do that?
i try to put my email in the sitecontroler where it says ‘adminmail’
but its not go well
help plz?
Hi
So what’s your actionContact’s code looking now?
look like this
/**
* Displays the contact page
*/
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);
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));
}
Just check your server support mail functionality…
and
print each and every parameters passed in mail function as they are set well…
Change in the config/main the param adminEmail
nope
did that but still get this error massage
mail() [<a href=‘function.mail’>function.mail</a>]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set()
That means that you don’t have the mailserver properly configured in your machine, is not related with yii
hi
tnx so much so far
i try to search the web how to that - didnt realy get how
do u know how to do that pls?
It depends on your system, you have to install a mail server.
OK
SO I HAVE WIN 7
WHICH ONE IS THE BEST FOR THIS DO YOU THINK?
u may upload this to ur server…and check thats simple.
I am not an expert of windows.
Take a look at google.
In any case, this is not a Yii problem, but a server configuration one.
I suggest that you use Mailchimp Mandrill. It will make your infrastructure simpler.
It is free if you only need a low amount of monthly email sending.