codeigniter - Placing image in e-mail header -


how can put images header before hello? can please me?

this view:

<body> <p>hello, <?php echo $first_name; ?> <?php echo $last_name; ?></p>  <p>please click link below reset password within 24 hours :</p>  <p> <a href="<?php echo base_url(); ?>recover/response/<?php echo $secret; ?>/">click here reset password</a> </p>  <p> regards,<br> customer service. </p>     </body> 

try this

$to = '';//assign mail $subject = 'email subject';  $message = '<html><body>'; $message .= '<img src="http://example.com/123.png" alt="your image" />';//image $message .= '<p>hello, <?php echo $first_name; ?> <?php echo $last_name; ?></p>'; $message .= '<p>please click link below reset password within 24 hours :</p>'; $message .= '<p><a href="<?php echo base_url(); ?>recover/response/<?php echo $secret; ?>/">click here reset</a></p>'; $message .= '<p>regards,<br>customer service.</p>'; $message .= "</body></html>"; 

before send in header

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

sending mail

mail($to, $subject, $message, $headers); 

Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -