-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