Ich sende eine E-Mail, indem ich die E-Mail aus einer Ansichtsdatei lade.E-Mail wird mit HTML-Tags anstelle von Klartext gesendet
Meine E-Mail mit HTML-Tags wie folgt gesendet:
<html><body>Hi mom!</body></html>
ich es will, ohne die Tags gesendet werden, im Klartext:
Hi mom!
Siehe Code unten:
public function savepromo(){
$allemail = $this->AdminModel->getallemail();
$data['promos'] = $this->AdminModel->getallpromos();
$totalrows = $this->AdminModel->countemail();
if ($totalrows > 0) {
$limit = 10;
$totalbatches = ceil($totalrows/$limit);
for ($batch = 0; $batch < $totalbatches; $batch++){
$offset = $batch * $limit;
$batch_record = array();
$destination = "";
foreach ($this->AdminModel->fetchrecords($limit,$offset) as $value){
array_push($batch_record,$value->email);
}
$destination = implode(';', $batch_record);
$config = array(
'charset' => 'utf-8',
'wordwrap' => TRUE,
'mailtype'=> 'html'
);
$this->load->initialize($config);
$fromemail="[email protected]";
$toemail = $destination;
$subject = "THIS IS FOR TESTING PURPOSES DONT MIND THIS MESSAGE!";
$mesg = $this->load->view('email/promomessage',$data,TRUE);
$this->load->library('email');
$this->email->from($fromemail, 'MY TESTING EMAIL');
$this->email->to($destination);
$this->email->subject($subject);
$this->email->message($mesg);
$this->email->send();
}
}
$this->session->set_flashdata('try', '<div class="alert alert-danger text-center">SUCCESS!</div>');
redirect('administrator/createpromo');
}
}
meinst du der Empfänger sieht '
Hallo Mama! 'anstelle von' Hallo Mama! '? –Ja, ist mein Code falsch? – erinr
Sie haben CI nicht mitgeteilt, dass Sie eine HTML-E-Mail senden, daher wurde der HTML-Code als einfacher Text ausgegeben und als solcher gerendert. –