我是 PHP 和 Zend 的新手。
我试图弄清楚某些应用程序中使用了什么 smtp 服务器。它只有以下代码并且不适用于任何传输设置(例如 Zend_Mail_Transport_Smtp)。我还查看了 application.ini 等。我试图找出这个应用程序的用户名和密码是什么。有什么建议可以存储这些信息吗?
$mail = new Zend_Mail();
$mail->setFrom(Zend_Registry::get('config')->app->contact->email);
$mail->addTo($this->getUscEmail(), $this->getFirstName().' '.$this->getLastName());
$mail->addCc(Zend_Registry::get('config')->app->contact->email, 'SOWK FWS');
$mail->setSubject('Workstudy Documentation - '.$this->getFirstName().' '.$this->getLastName());
$mail->setBodyText('Hi '.$this->getFirstName().",\r\n".'Congratulations on completing your Orientation!);
$mail->send();
编辑 1: 我的 application.ini 文件的这一部分:
##Application
app.invalid_login.max = 3
app.invalid_login.wait = 10
app.contact.email = cccc@ccc.com
app.admin.email = aaaaan@aaa.com
app.number_questions_to_ask.max = 5
app.data_path = APPLICATION_PATH "/../data/"
app.pdf_path = APPLICATION_PATH "/../data/PDF/"
##Session
resources.session.save_path = APPLICATION_PATH "/../data/session"
resources.session.use_only_cookies = true
resources.session.remember_me_seconds = 3600
resources.session.name = "Work_Study"
php.ini:
[mail function]
; For Win32 only.
SMTP = email.ccc.com
; For Win32 only.
;sendmail_from = me@example.com
sendmail_from = example@ccc.com
; For Unix only. You may supply arguments as well (default: "sendmail -t -i").
;sendmail_path =
这是我在使用传输对象发送电子邮件之前打印传输对象时的输出:
Transport ==> object(Zend_Mail_Transport_Sendmail)#215 (12) {
["subject"]=>
NULL
["parameters"]=>
NULL
["EOL"]=>
string(2) "
"
["_errstr:protected"]=>
NULL
["body"]=>
string(0) ""
["boundary"]=>
string(0) ""
["header"]=>
string(0) ""
["_headers:protected"]=>
array(0) {
}
["_isMultipart:protected"]=>
bool(false)
["_mail:protected"]=>
bool(false)
["_parts:protected"]=>
array(0) {
}
["recipients"]=>
string(0) ""
}
谢谢。