email message in spam

im using yiiMailer extention…

i send email to both admin and user.But the two message are going in spam not in inbox…

why…? How can i set it…?

:blink: :blink: :( :(

Thanx

Try to send mail using SMTP with login authentication… so enable SMTPAuth & choose SMTPSecure is SSL.


'SMTPSecure' => 'ssl',

'SMTPAuth' => true,

so…


$mail->setSmtp('smtp.gmail.com', 465, 'ssl', true, 'your_email@gmail.com', 'your_password');

thanks for you valuable reply…

im already defines this…the email going in spam…

:-[

First of all - contact email server administrator and check what are the rules that cause your emails to be reported as spam. If may be problem with:

  • not using SSL (but not likely)

  • sending emails from IP not enclosed in SPF

  • missing DKIM signature

  • content classified as spam by SpamAssassin on mail server

  • many other factors specific to your server and its admin imagination…

Now try to send any different email id and check their inbox. If still email is in spam so may be issue with your email id (which is you are using to sending emails and may it’s on black-listed ip).

Give your response here…

this is my codes

where is i change…?

sitecontroller


public function actionContact()

{


	$model=new ContactForm;


	if(isset($_POST['ContactForm']))


	{


		$model->attributes=$_POST['ContactForm'];





		if($model->validate())


		{


			$adminname="administator";


			$name='=?UTF-8?B?'.base64_encode($model->name).'?=';


            $subject='my subject';


            $headers="From: $name <{$model->email}>\r\n".


                "Reply-To: {$model->email}\r\n".


                "MIME-Version: 1.0\r\n".


                "Content-Type: text/plain; charset=UTF-8";

;

			$mail = new YiiMailer();


			$mail->setFrom($model->email);


			$mail->setTo(Yii::app()->params['adminEmail']);


			$mail->setSubject($subject);


			$mail->setBody($model->message);	


			$mail->IsSMTP();





			if($mail->send())


			{


				$autoemail = new YiiMailer(); 


				$autoemail->From = Yii::app()->params['adminEmail']; 


				//$autoemail->FromName = $adminname; 


				$autoemail->AddAddress($mail->From); 


				$autoemail->FromName = $adminname; 


				$autoemail->Subject = ($subject); 


				$autoemail->IsHTML(true);


				$autoemail->Body = "We received your submission. We will contact you soon ...";


				$autoemail->IsSMTP();


				$autoemail->Send();


				


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


			


			}


			else


			{


			


				Yii::app()->user->setFlash('error','Sorry your message cannot be send... ');


		


			}





			$this->refresh();


		}


	}


	


	$this->render('contact',array('model'=>$model));


}

main.php


‘import’=>array(

	'application.models.*',


	'application.components.*',


	'ext.YiiMailer.YiiMailer',

‘YiiMailer’=>array(

        'Host'=>"smtp.gmail.com",


        'Port'=>465,


        'SMTPSecure'=>'ssl',


        'SMTPAuth'=>true,


        'Username'=>'myGmailUsername',


        'Password'=>'myGmailPassword',


        'Mailer'=>'smtp',

‘params’=>array(

	// this is used in contact page


	'adminEmail'=>'myGmailUsername',

thanks…

im change another valid emails…not working…

any technichal problems…?

I prefer you use this extension, it’s work for me fine…

Put in your config (main.php)-


'Smtpmail'=>array(

            'class'=>'application.extensions.smtpmail.PHPMailer',

            'Host'=>"smtp.gmail.com",

            'Username'=>'your_email_id@gmail.com',

            'Password'=>'******',

            'Mailer'=>'smtp',

            'Port'=>587,

            'SMTPAuth'=>true, 

	    'SMTPSecure' => 'tls',

        ),



Your mail sending code (Put in your view or controller as per the use) -




$to = 'demo@example.com'; //Email id, which you want to send an email

$from= 'your_email_id@gmail.com'; //Email id, provide your email id


$mail=Yii::app()->Smtpmail;

$mail->SetFrom($from, 'Yii Demo');

$mail->Subject = 'your email subject';

$mail->MsgHTML('Testing...');

$mail->AddAddress($to, "");

$mail->IsHTML(true);

$mail->Send();

Extension Link - http://www.yiiframework.com/extension/smtp-mail/

thanks a lot…

its working fine…thanx…

don"t forget to vote this post !

THANKS Rohit this wiki is very helpfull :)

Enjoy dude::)

Your welcome::)