简体   繁体   English

时事通讯HTML电子邮件

[英]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[]). 我的新闻通讯的用户可以在文本区域中编辑文本,之后单击预览按钮时可以保存已编辑的文本。在此页面中,将显示所有使用PHP($ _POST [])编辑的文本。 when SendNewsLetter button is clicked mail is sent but without any text in it, as am using PHP to display text. 单击SendNewsLetter按钮时,会发送邮件,但其中没有任何文本,就像使用PHP来显示文本一样。 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. 以下是无法在电子邮件正文中使用的php代码。 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() 这是我的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. 有HTML内容或文本或正文而不是消息的选项。

look into you view function. 查看您的查看功能。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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