How to prevent HTML email not ending up in junk folder in hotmail?

738 Views Asked by At

I have been sending an email to the user who signs up on my website. The email is correctly being sent to inbox folder in other services like gmail, yahoo but in case of hotmail sometimes it ends up in junk folder and sometimes it goes to inbox.

Below is my email code snippet from my registration code:

                $user->save();
                $activationUrl = Yii::app()->request->getBaseUrl(true) . '/site/activateaccount?activation_key=' . $activationKey;
                $body = $this->renderPartial('accounts/registration_email', array('activationUrl' => $activationUrl), true);

                $subject = 'Please complete your signup';
                $headers = 'MIME-Version: 1.0' . "\r\n";
                $headers .= 'From: Website Name<[email protected]>' . "\r\n";
                $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
                $headers.='Reply-To: [email protected]' . "\r\n";
                $headers.='Return-Path: [email protected]\r\n';

                if (mail($user->email, $subject, $body, $headers)) {
                    $this->redirect('registersuccess');
                }

Please note that the email I send is HTML email and in above code I have replaced website domain with mydomain.com for privacy and website actual name with Website Name. I have tried changing email subject line, MIME-version and content type. Tried so many solutions already posted on SO here but no one makes it always go to inbox rather than junk.

My clinet has email account on hotmail so he wants that email to end up in inbox no matter what. Can something be done as sure shot solution? Does installing SSL on site domain solves this issue? Any other solution?

0

There are 0 best solutions below