Mail() [<A Href='function.mail'>Function.mail</a>]: Failed To Connect To Mailserver At &quot;localhost&quot; Port 25, Verify You


Actually I have added image upload field on default contact-us form. form is properly show the upload image button and validation is also working for image upload field but when we upload the image and click on submit button we are getting below error message. please help me to sort out this issue…and Image also not uploaded on folder location

mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set()


49 /**

50 * Displays the contact page

51 */

52 public function actionContact()

53 {

54 $model=new ContactForm;

55 if(isset($_POST[‘ContactForm’]))

56 {

57 $model->attributes=$_POST[‘ContactForm’];

58 if($model->validate())

59 {

60 $headers="From: {$model->email}\r\nReply-To: {$model->email}";

61 mail(Yii::app()->params[‘adminEmail’],$model->subject,$model->body,$headers);

62 Yii::app()->user->setFlash(‘contact’,‘Thank you for contacting us. We will respond to you as soon as possible.’);

63 $this->refresh();

64 }

65 }

66 $this->render(‘contact’,array(‘model’=>$model));

67 }


69 /**

70 * Displays the login page

71 */

72 public function actionLogin()

73 {

mail() is a standard PHP function. Please check with your system administrator or your host why it doesn’t work, or how to make it work.

Yes you are right but i want to remove this error either mail will be send or not with the relevant message…M main question is related with image uploading …why image is not uploading…Please find the attached file to view my code.