0

Quick Question!

I need to change the SMTP details in a Typo3 site. Normally, you can do this by going to the install tool > all configuration. That however is password protested and I don't know it! (The guy who does know it is not available)

Can I change these details directly from a file in the FTP server? If so, which file? I can't find it, and any documentation I've checked out doesn't help!

Ty!

4

3 回答 3

2

安装工具的配置存储在typo3conf/localconf.php(直到 4.7 版)或typo3conf/LocalConfiguration.php(从 6.0 版开始)。

必须将有关 SMTP 的配置放入 $TYPO3_CONF_VARS['MAIL']:

$TYPO3_CONF_VARS['MAIL'] = array(
    'transport' => 'smtp',
    'transport_smtp_server' => 'smtp.yourdomain.org',
    'transport_smtp_encrypt' => 'ssl', /* Usually available: ssl, sslv2, sslv3, tls. Check stream_get_transports(). */
    'transport_smtp_username' => 'username',
    'transport_smtp_username => 'password',
);

两个版本生成文件的格式不同,但是数组结构是一样的。请注意,安装工具可能会覆盖对 localconf.php/LocalConfiguration.php 的更改。

于 2013-08-27T16:32:11.937 回答
1

除了@jost 答案,您还可以在localconf 中临时设置:

$TYPO3_CONF_VARS['BE']['installToolPassword'] = 'bacb98acf97e0b6112b1d1b650b84971';

它对应于众所周知的“joh316”并可以访问安装工具。

完成更改后,不要忘记恢复旧的安装工具密码哈希!

于 2013-08-29T20:11:26.767 回答
0

在你的 localconf.php 添加

$TYPO3_CONF_VARS['MAIL']['transport'] = 'smtp';
$TYPO3_CONF_VARS['MAIL']['transport_smtp_server'] = 'smtp.gmail.com:465';
$TYPO3_CONF_VARS['MAIL']['transport_smtp_port'] = '465';
$TYPO3_CONF_VARS['MAIL']['transport_smtp_encrypt'] ='ssl'; # requires openssl in PHP
$TYPO3_CONF_VARS['MAIL']['transport_smtp_username'] = '*****@gmail.com';
$TYPO3_CONF_VARS['MAIL']['transport_smtp_password'] = '*****';

然后在你的 php 文件中使用

$mailContent = $mailcontent;
$mailContent = ($mailContent);
// Create the Mailer using your created Transport
$mail = t3lib_div::makeInstance('t3lib_mail_Message');

 $mail->setFrom(array('sender email' => 'sender name'));

//$mail->setBcc(array($this->bcc => $this->bcc));
$mail->setSubject($subject);
$mail->setBody($mailContent,'text/html');
$mail->setTo(array('reciever email' => 'name'));    
$mail->send();
于 2014-01-24T13:14:10.603 回答