简体   繁体   中英

Newsletter Html email

I have prepared a newsletter with some edit textareas and some default text in it. User of my newsletter is able to edit text in text area, after which am saving the edited text when he clicks on preview button, In this page am showing all the text edited using PHP ($_POST[]). when SendNewsLetter button is clicked mail is sent but without any text in it, as am using PHP to display text. Is there any alternate way to display dynamic content in mail body. Thank in advance, Please help me out of this.

Below is the php code which is not working in email body. In preview it displays fine.

<table cellspacing="0" cellpadding="0" border="1"  width="300px" height="auto" >
    <tr><td><?php echo set_value('input1',$_POST['input1']); ?></td></tr>
</table>

This is my sendemail()

public function newsemail(){
$this->load->library('email');
$config['mailtype'] = 'html';
$header = $this->load->view('index/news1','',true);
$this->email->initialize($config);
$this->email->from('info@xyz.net', 'xyz Consulting');
$this->email->reply_to('info@xyz.net','xyz Consulting');
$this->email->to('mahboob@gmail.com');
//$this->email->cc('mehboob029@gmail.com');
$this->email->bcc('xyz@gmail.com');
$this->email->subject('Newsletter');
$this->email->message( $header );
$mail = $this->email->send();

Its depends on you loaded library..

there is option for HTML content or text, or body rather than message.

look into you view function.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM