sending html email using php not working -



trying sending html email using php mail function. below code using.

public function sendactivationmail($activationcode="",$receiveremail=""){     $subject="registration confirmation";     $body="<html><body>";     $body.="<p>thank registering us. please activate account clicking activation link ";     $body.="<a href=".$this->url()->fromroute('login/default',array('controller'=>'index','action'=>'activation','id'=>'abc121')).">activate</a></p>";     $body.="</body></html>";     $headers  = 'mime-version: 1.0' . "\r\n";     $headers .= 'content-type: text/html; charset=iso-8859-1'."\r\n";     $headers .= 'from: abc@gmail.com'."\r\n".'reply-to: abc@gmail.com'."\r\n" .'x-mailer: php/' . phpversion();     $status=mail($receiveremail,$subject,$body,$headers);     if($status){         return true;     }else{         echo "error in sending mail";         exit();     }  } 

but when checked email html tags appears text don't know why?

you need use

$headers .= "content-type: text/html; charset=iso-8859-1\r\n"; 

*-type in camelcase


Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -