Ajout la possibilité de configurer l'envoi de mail
This commit is contained in:
parent
da3836d96e
commit
1d4a18065b
24
fileRead.php
24
fileRead.php
@ -133,10 +133,30 @@ if ( isset($opts->file) )
|
||||
$txt.= "Taille du fichier : $size\n";
|
||||
|
||||
$mail = new Zend_Mail('UTF-8');
|
||||
$tr = new Zend_Mail_Transport_Smtp('smtp.celeste.fr');
|
||||
// --- Configuration du transport SMTP
|
||||
if ( $c->profil->mail->method == 'smtp' ) {
|
||||
$config = array();
|
||||
if ( isset($this->config->auth) ) {
|
||||
$config['auth'] = $this->config->auth;
|
||||
if ( isset($this->config->username) ) {
|
||||
$config['username'] = $c->profil->mail->username;
|
||||
}
|
||||
if ( isset($this->config->password) ) {
|
||||
$config['password'] = $c->profil->mail->password;
|
||||
}
|
||||
}
|
||||
if ( isset($this->config->port) ) {
|
||||
$config['port'] = $c->profil->mail->port;
|
||||
}
|
||||
$tr = new Zend_Mail_Transport_Smtp($c->profil->mail->host, $config);
|
||||
}
|
||||
// --- Configuration transport Sendmail
|
||||
if ( $this->config->mail->method == 'sendmail' ) {
|
||||
$tr = new Zend_Mail_Transport_Sendmail();
|
||||
}
|
||||
$mail->setDefaultTransport($tr);
|
||||
$mail->setBodyText($txt);
|
||||
$mail->setFrom('supportdev@scores-decisions.com', 'Machine');
|
||||
$mail->setFrom('supportdev@scores-decisions.com', 'Machine Flux');
|
||||
$mail->addTo('suivi@scores-decisions.com', 'Suivi');
|
||||
$mail->setSubject($subject);
|
||||
$mail->send();
|
||||
|
24
fileRecv.php
24
fileRecv.php
@ -174,10 +174,30 @@ if ( $result->count() > 0 ) {
|
||||
$txt.= "Nombre de Lignes : $nbLines\n";
|
||||
|
||||
$mail = new Zend_Mail('UTF-8');
|
||||
$tr = new Zend_Mail_Transport_Sendmail();
|
||||
// --- Configuration du transport SMTP
|
||||
if ( $c->profil->mail->method == 'smtp' ) {
|
||||
$config = array();
|
||||
if ( isset($this->config->auth) ) {
|
||||
$config['auth'] = $this->config->auth;
|
||||
if ( isset($this->config->username) ) {
|
||||
$config['username'] = $c->profil->mail->username;
|
||||
}
|
||||
if ( isset($this->config->password) ) {
|
||||
$config['password'] = $c->profil->mail->password;
|
||||
}
|
||||
}
|
||||
if ( isset($this->config->port) ) {
|
||||
$config['port'] = $c->profil->mail->port;
|
||||
}
|
||||
$tr = new Zend_Mail_Transport_Smtp($c->profil->mail->host, $config);
|
||||
}
|
||||
// --- Configuration transport Sendmail
|
||||
if ( $this->config->mail->method == 'sendmail' ) {
|
||||
$tr = new Zend_Mail_Transport_Sendmail();
|
||||
}
|
||||
$mail->setDefaultTransport($tr);
|
||||
$mail->setBodyText($txt);
|
||||
$mail->setFrom('supportdev@scores-decisions.com', 'Machine');
|
||||
$mail->setFrom('supportdev@scores-decisions.com', 'Machine Flux');
|
||||
$mail->addTo('suivi@scores-decisions.com', 'Suivi');
|
||||
$mail->setSubject($subject);
|
||||
$mail->send();
|
||||
|
24
fileSend.php
24
fileSend.php
@ -210,10 +210,30 @@ if ( isset($opts->file) )
|
||||
$txt.= "Taille du fichier : $size\n";
|
||||
|
||||
$mail = new Zend_Mail('UTF-8');
|
||||
$tr = new Zend_Mail_Transport_Smtp('smtp.celeste.fr');
|
||||
// --- Configuration du transport SMTP
|
||||
if ( $c->profil->mail->method == 'smtp' ) {
|
||||
$config = array();
|
||||
if ( isset($this->config->auth) ) {
|
||||
$config['auth'] = $this->config->auth;
|
||||
if ( isset($this->config->username) ) {
|
||||
$config['username'] = $c->profil->mail->username;
|
||||
}
|
||||
if ( isset($this->config->password) ) {
|
||||
$config['password'] = $c->profil->mail->password;
|
||||
}
|
||||
}
|
||||
if ( isset($this->config->port) ) {
|
||||
$config['port'] = $c->profil->mail->port;
|
||||
}
|
||||
$tr = new Zend_Mail_Transport_Smtp($c->profil->mail->host, $config);
|
||||
}
|
||||
// --- Configuration transport Sendmail
|
||||
if ( $this->config->mail->method == 'sendmail' ) {
|
||||
$tr = new Zend_Mail_Transport_Sendmail();
|
||||
}
|
||||
$mail->setDefaultTransport($tr);
|
||||
$mail->setBodyText($txt);
|
||||
$mail->setFrom('supportdev@scores-decisions.com', 'Machine');
|
||||
$mail->setFrom('supportdev@scores-decisions.com', 'Machine Flux');
|
||||
$mail->addTo('suivi@scores-decisions.com', 'Suivi');
|
||||
$mail->setSubject($subject);
|
||||
$mail->send();
|
||||
|
@ -27,6 +27,9 @@ profil.db.metier.params.password=2XQTpKatBVRezXE9
|
||||
profil.db.metier.params.dbname=sdv1
|
||||
profil.db.metier.params.driver_options.MYSQLI_INIT_COMMAND = "SET NAMES utf8"
|
||||
|
||||
; Mail configuration
|
||||
profil.db.method = sendmail
|
||||
|
||||
[staging : production]
|
||||
resources.frontController.params.displayExceptions = 1
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user