本文整理汇总了PHP中Zend_Mail::setDefaultReplyTo方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Mail::setDefaultReplyTo方法的具体用法?PHP Zend_Mail::setDefaultReplyTo怎么用?PHP Zend_Mail::setDefaultReplyTo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_Mail
的用法示例。
在下文中一共展示了Zend_Mail::setDefaultReplyTo方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _initMail
protected function _initMail()
{
Zend_Mail::setDefaultFrom('xlr8ufitness@live.com.au', 'XLR8U Fitness');
Zend_Mail::setDefaultReplyTo('xlr8ufitness@live.com.au', 'XLR8U Fitness');
$transport = new Zend_Mail_Transport_Sendmail();
Zend_Mail::setDefaultTransport($transport);
}
示例2: __construct
public function __construct()
{
$tr = new Zend_Mail_Transport_Smtp(Zend_Registry::get('Setting')->EMAIL_SMTP_HOST, array('auth' => 'login', 'username' => Zend_Registry::get('Setting')->EMAIL_SMTP_USER, 'password' => Zend_Registry::get('Setting')->EMAIL_SMTP_PASS, 'port' => Zend_Registry::get('Setting')->EMAIL_SMTP_PORT));
if (Zend_Registry::get('Setting')->EMAIL_SMTP_SSL) {
array('ssl' => Zend_Registry::get('Setting')->EMAIL_SMTP_SSL);
}
Zend_Mail::setDefaultTransport($tr);
Zend_Mail::setDefaultFrom(Zend_Registry::get('Setting')->webmaster_email, Zend_Registry::get('Setting')->webmaster_name);
Zend_Mail::setDefaultReplyTo(Zend_Registry::get('Setting')->webmaster_email, Zend_Registry::get('Setting')->webmaster_name);
}
示例3: _getFallBackTransport
/**
* Get the fallback Transport, used if the plugin is disabled
* @return Zend_Mail_Transport_Sendmail
*/
protected function _getFallBackTransport($parameters = null)
{
Zend_Mail::setDefaultFrom($this->settings->siteEmail);
Zend_Mail::setDefaultReplyTo($this->settings->siteEmail, $this->seoOption->siteName);
return new Zend_Mail_Transport_Sendmail($parameters);
}
示例4: init
/**
* Initializes the mailer with the settings form Settings -> System -> Email Settings
*
* @return void
*/
public function init($type = "email")
{
$systemConfig = \Pimcore\Config::getSystemConfig()->toArray();
$emailSettings =& $systemConfig[$type];
if ($emailSettings['sender']['email']) {
\Zend_Mail::setDefaultFrom($emailSettings['sender']['email'], $emailSettings['sender']['name']);
}
if ($emailSettings['return']['email']) {
\Zend_Mail::setDefaultReplyTo($emailSettings['return']['email'], $emailSettings['return']['name']);
}
if ($emailSettings['method'] == "smtp") {
$config = array();
if ($emailSettings['smtp']['name']) {
$config['name'] = $emailSettings['smtp']['name'];
}
if ($emailSettings['smtp']['ssl']) {
$config['ssl'] = $emailSettings['smtp']['ssl'];
}
if ($emailSettings['smtp']['port']) {
$config['port'] = $emailSettings['smtp']['port'];
}
if ($emailSettings['smtp']['auth']['method']) {
$config['auth'] = $emailSettings['smtp']['auth']['method'];
$config['username'] = $emailSettings['smtp']['auth']['username'];
$config['password'] = $emailSettings['smtp']['auth']['password'];
}
$transport = new \Zend_Mail_Transport_Smtp($emailSettings['smtp']['host'], $config);
\Zend_Mail::setDefaultTransport($transport);
}
//setting debug email addresses
if ($type == "email" && empty(self::$debugEmailAddresses)) {
if ($emailSettings['debug']['emailaddresses']) {
foreach (explode(',', $emailSettings['debug']['emailaddresses']) as $emailAddress) {
self::$debugEmailAddresses[] = $emailAddress;
}
}
}
$this->placeholderObject = new \Pimcore\Placeholder();
}
示例5: testMethodSendUsesDefaults
public function testMethodSendUsesDefaults()
{
Zend_Mail::setDefaultFrom('john@example.com', 'John Doe');
Zend_Mail::setDefaultReplyTo('foo@example.com', 'Foo Bar');
$mail = new Zend_Mail();
$mail->setBodyText('Defaults Test');
$mock = new Zend_Mail_Transport_Mock();
$mail->send($mock);
$headers = $mock->headers;
$this->assertTrue($mock->called);
$this->assertEquals($mock->from, 'john@example.com');
$this->assertEquals($headers['From'][0], 'John Doe <john@example.com>');
$this->assertEquals($headers['Reply-To'][0], 'Foo Bar <foo@example.com>');
}
示例6: initMail
protected function initMail()
{
if (isset($this['mail.from.email'])) {
\Zend_Mail::setDefaultFrom($this['mail.from.email'], $this['mail.from.name']);
}
if (isset($this['mail.replyto.email'])) {
\Zend_Mail::setDefaultReplyTo($this['mail.replyto.email'], $this['mail.replyto.name']);
}
// Create transport
switch (strtolower($this['mail.method'])) {
case 'smtp':
$transport = new \Zend_Mail_Transport_Smtp($this['mail.host'], (array) $this['mail.options']);
\Zend_Mail::setDefaultTransport($transport);
break;
case 'sendmail':
default:
$transport = new \Zend_Mail_Transport_Sendmail((array) $this['mail.options']);
\Zend_Mail::setDefaultTransport($transport);
break;
}
}
示例7: getMail
/**
* @static
* @param $sender
* @param $recipients
* @param $subject
* @return Zend_Mail
*/
public static function getMail($recipients = null, $subject = null)
{
$values = Pimcore_Config::getSystemConfig();
$valueArray = $values->toArray();
$emailSettings = $valueArray["email"];
$mail = new Zend_Mail("UTF-8");
if (!empty($emailSettings['sender']['email'])) {
$mail->setDefaultFrom($emailSettings['sender']['email'], $emailSettings['sender']['name']);
}
if (!empty($emailSettings['return']['email'])) {
$mail->setDefaultReplyTo($emailSettings['return']['email'], $emailSettings['return']['name']);
}
if ($emailSettings['method'] == "smtp") {
$config = array();
if (!empty($emailSettings['smtp']['name'])) {
$config['name'] = $emailSettings['smtp']['name'];
}
if (!empty($emailSettings['smtp']['ssl'])) {
$config['ssl'] = $emailSettings['smtp']['ssl'];
}
if (!empty($emailSettings['smtp']['port'])) {
$config['port'] = $emailSettings['smtp']['port'];
}
if (!empty($emailSettings['smtp']['auth']['method'])) {
$config['auth'] = $emailSettings['smtp']['auth']['method'];
$config['username'] = $emailSettings['smtp']['auth']['username'];
$config['password'] = $emailSettings['smtp']['auth']['password'];
}
$transport = new Zend_Mail_Transport_Smtp($emailSettings['smtp']['host'], $config);
//Logger::log($transport);
//Logger::log($config);
$mail->setDefaultTransport($transport);
}
if ($recipients) {
if (is_string($recipients)) {
$mail->addTo($recipients);
} else {
if (is_array($recipients)) {
foreach ($recipients as $recipient) {
$mail->addTo($recipient);
}
}
}
}
if ($subject) {
$mail->setSubject($subject);
}
return $mail;
}
示例8:
// Create application, bootstrap, and run
$application = new Zend_Application(APPLICATION_ENV, APPLICATION_PATH . '/configs/application.ini');
// the database adapter for the session
Zend_Registry::set("dbAdapter", $application->getBootstrap()->getPluginResource('db')->getDbAdapter());
$cache = $application->getBootstrap()->getPluginResource('cachemanager')->getCacheManager()->getCache('database');
Zend_Registry::set('cache', $cache);
# Zend Translate instance
$translate = new Zend_Translate(array('adapter' => 'ini', 'content' => APPLICATION_PATH . '/configs/en.language.ini'));
# $translate->setCache($cache); // the caching of the translate seems to cause an error, do not know why
Zend_Registry::set('translate', $translate);
# Zend Logger instance
Zend_Registry::set("logger", $application->getBootstrap()->getPluginResource('log')->getLog());
# currency object
$currency = new Zend_Currency('en_US');
$currency->setCache($cache);
Zend_Registry::set('currency', $currency);
# Zend Mail instance
// create a new instance
$mailer = new Zend_Mail('utf8');
// set the default transport configured in application.ini
$mailer->setDefaultTransport($application->getBootstrap()->getPluginResource('mail')->getMail());
// set the default to and from addresses
$mail_config = new Zend_Config($application->getBootstrap()->getPluginResource('mail')->getOptions());
$mailer->setDefaultFrom($mail_config->defaultFrom->email, $mail_config->defaultFrom->name);
$mailer->setDefaultReplyTo($mail_config->defaultReplyTo->email, $mail_config->defaultReplyTo->name);
// add the mail instance to the registry
Zend_Registry::set("mail", $mailer);
// add caching for Zend_Table which is used for Session information
Zend_Db_Table_Abstract::setDefaultMetadataCache($cache);
# run the default page
$application->bootstrap()->run();