How to display an image in email in codeigniter

后端 未结 1 876
半阙折子戏
半阙折子戏 2021-01-27 17:49

Controller

public function index(){
     send_mail(\'New Volunteer Form received\', $this->load->view(\'site/email/volunteer\', NULL, TRUE         


        
相关标签:
1条回答
  • 2021-01-27 18:03

    Try this

    $this->email->attach('/path/to/photo1.jpg', 'inline');
    

    or

    $message = '<td>Photo</td>';
    $message .= '<td style="text-align: center">';
    $message .= '<img src="<?php base_url() ?>uploads/volunteer/<?php echo $_POST['."userfile".']; ?>" height="100" width="150">';
    $message .= '</td></tr>';
    

    To use the default disposition (attachment), leave the second parameter blank, otherwise use a custom disposition

    0 讨论(0)
提交回复
热议问题