-2
<?php
$subject = $this->language->get('text_subject');
$message = "este es el mensaje";
$html = "<html><head><title>Documento sin título</title></head><table>
<tr>
<td>Ticket</td>
<td>Status</td>
<td>action</td>
<td>account type</td>
</tr>
<tr>
<td>1</td>
<td>COMPLETED</td>
<td>CREATE</td>
<td>DEMO</td>
</tr>
</table><body></body></html>"
$mail = new Mail();
$mail->protocol = $this->config->get('config_mail_protocol');
$mail->parameter = $this->config->get('config_mail_parameter');
$mail->hostname = $this->config->get('config_smtp_host');
$mail->username = $this->config->get('config_smtp_username');
$mail->password = $this->config->get('config_smtp_password');
$mail->port = $this->config->get('config_smtp_port');
$mail->timeout = $this->config->get('config_smtp_timeout');
$mail->setTo($customer_query->row['email']);
$mail->setFrom($this->config->get('config_email'));
$mail->setSender($this->config->get('config_name'));
$mail->setSubject(html_entity_decode($subject, ENT_QUOTES, 'UTF-8'));
$mail->setHtml($html);
$mail->setText(html_entity_decode($message, ENT_QUOTES, 'UTF-8'));
$mail->send();?>
我有這樣的代碼來發送電子郵件PHP,$html
包含代碼的HTML來發送郵件,但僅出現在HTML代碼和文本不會出現。代碼中有錯誤?發送電子郵件與PHP和HTML內容
你使用哪個類來發送電子郵件。必須有一些選項可以設置發送的HTML電子郵件。和$ html我希望是在我的腳本中定義的 – 2014-09-24 05:51:01
我修改了代碼 – 2014-09-24 05:55:18
文本正文設置爲$ message,這只是「este es el mensaje」 - 是你想發送什麼? – PeterK 2014-09-24 06:09:47