脚本宝典收集整理的这篇文章主要介绍了php – Opencart在自定义脚本中发送电子邮件,脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。
这是我的代码:
$email_to = "somewhere@example.COM"; $config = new Config(); $mail = new Mail(); $mail->PRotocol = $config->get('config_mail_protocol'); $mail->parameter = $config->get('config_mail_parameter'); $mail->hostname = $config->get('config_smtp_host'); $mail->username = $config->get('config_smtp_username'); $mail->password = $config->get('config_smtp_password'); $mail->port = $config->get('config_smtp_port'); $mail->timeout = $config->get('config_smtp_timeout'); $mail->setTo($email_to); $mail->setFrom("nuno@[mydomain].com"); $mail->setSender("nuno@[mydomain].com"); $mail->setSubject("test send mail"); $mail->setText("test message body text"); $mail->send();
$email_to = "somewhere@example.com"; $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($email_to); $mail->setFrom("somewhere@example.com"); $mail->setSender("somewhere@example.com"); $mail->setSubject("test send mail"); $mail->setText("test message body text"); $mail->send();
以上是脚本宝典为你收集整理的php – Opencart在自定义脚本中发送电子邮件全部内容,希望文章能够帮你解决php – Opencart在自定义脚本中发送电子邮件所遇到的问题。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。