我的opencart中有一个脚本,由我自己制作,并想让它发送一封电子邮件,但我认为当我尝试获取电子邮件参数时,它们会返回null
。
这是我的代码:
$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();
当我尝试调用时:echo $config->get('config_mail_protocol');
它返回null
.