├── .travis.yml ├── README ├── _test ├── general.test.php └── message.test.php ├── action.php ├── admin.php ├── admin.svg ├── classes ├── Logger.php └── Message.php ├── conf ├── default.php └── metadata.php ├── helper.php ├── lang ├── ar │ ├── intro.txt │ ├── lang.php │ └── settings.php ├── cs │ ├── intro.txt │ ├── lang.php │ └── settings.php ├── da │ ├── intro.txt │ ├── lang.php │ └── settings.php ├── de-informal │ ├── intro.txt │ ├── lang.php │ └── settings.php ├── de │ ├── intro.txt │ ├── lang.php │ └── settings.php ├── en │ ├── intro.txt │ ├── lang.php │ └── settings.php ├── eo │ ├── intro.txt │ ├── lang.php │ └── settings.php ├── es │ ├── intro.txt │ ├── lang.php │ └── settings.php ├── fr │ ├── intro.txt │ ├── lang.php │ └── settings.php ├── ja │ ├── intro.txt │ ├── lang.php │ └── settings.php ├── ko │ ├── intro.txt │ ├── lang.php │ └── settings.php ├── nl │ ├── intro.txt │ ├── lang.php │ └── settings.php ├── no │ ├── intro.txt │ ├── lang.php │ └── settings.php ├── pl │ ├── intro.txt │ ├── lang.php │ └── settings.php ├── pt-br │ ├── intro.txt │ ├── lang.php │ └── settings.php ├── ru │ ├── intro.txt │ ├── lang.php │ └── settings.php ├── sk │ └── settings.php ├── sv │ ├── intro.txt │ ├── lang.php │ └── settings.php ├── vi │ ├── intro.txt │ ├── lang.php │ └── settings.php └── zh │ ├── intro.txt │ ├── lang.php │ └── settings.php ├── loader.php ├── plugin.info.txt └── subtree ├── php-fig └── log │ ├── .gitignore │ ├── LICENSE │ ├── Psr │ └── Log │ │ ├── AbstractLogger.php │ │ ├── InvalidArgumentException.php │ │ ├── LogLevel.php │ │ ├── LoggerAwareInterface.php │ │ ├── LoggerAwareTrait.php │ │ ├── LoggerInterface.php │ │ ├── LoggerTrait.php │ │ ├── NullLogger.php │ │ └── Test │ │ └── LoggerInterfaceTest.php │ ├── README.md │ └── composer.json └── txtthinking └── Mailer ├── .gitignore ├── LICENSE ├── README.md ├── composer.json ├── composer.lock ├── phpunit.xml ├── src ├── Mailer.php └── Mailer │ ├── Exceptions │ ├── CodeException.php │ ├── CryptoException.php │ ├── SMTPException.php │ └── SendException.php │ ├── Message.php │ └── SMTP.php └── tests ├── MailerTest.php ├── SMTPTest.php └── TestCase.php /.travis.yml: -------------------------------------------------------------------------------- 1 | # Config file for travis-ci.org 2 | 3 | language: php 4 | php: 5 | - "7.3" 6 | - "7.2" 7 | - "7.1" 8 | - "7.0" 9 | - "5.6" 10 | env: 11 | - DOKUWIKI=master 12 | - DOKUWIKI=stable 13 | before_install: wget https://raw.github.com/splitbrain/dokuwiki-travis/master/travis.sh 14 | install: sh travis.sh 15 | script: cd _test && ./phpunit.phar --stderr --group plugin_smtp 16 | -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | smtp Plugin for DokuWiki 2 | 3 | Send mails via a configured SMTP server 4 | 5 | All documentation for this plugin can be found at 6 | https://www.dokuwiki.org/plugin:smtp 7 | 8 | If you install this plugin manually, make sure it is installed in 9 | lib/plugins/smtp/ - if the folder is called different it 10 | will not work! 11 | 12 | Please refer to http://www.dokuwiki.org/plugins for additional info 13 | on how to install plugins in DokuWiki. 14 | 15 | ---- 16 | Copyright (C) Andreas Gohr 17 | 18 | This program is free software; you can redistribute it and/or modify 19 | it under the terms of the GNU General Public License as published by 20 | the Free Software Foundation; version 2 of the License 21 | 22 | This program is distributed in the hope that it will be useful, 23 | but WITHOUT ANY WARRANTY; without even the implied warranty of 24 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 25 | GNU General Public License for more details. 26 | 27 | See the COPYING file in your DokuWiki folder for details 28 | -------------------------------------------------------------------------------- /_test/general.test.php: -------------------------------------------------------------------------------- 1 | assertFileExists($file); 16 | 17 | $info = confToHash($file); 18 | 19 | $this->assertArrayHasKey('base', $info); 20 | $this->assertArrayHasKey('author', $info); 21 | $this->assertArrayHasKey('email', $info); 22 | $this->assertArrayHasKey('date', $info); 23 | $this->assertArrayHasKey('name', $info); 24 | $this->assertArrayHasKey('desc', $info); 25 | $this->assertArrayHasKey('url', $info); 26 | 27 | $this->assertEquals('smtp', $info['base']); 28 | $this->assertRegExp('/^https?:\/\//', $info['url']); 29 | $this->assertTrue(mail_isvalid($info['email'])); 30 | $this->assertRegExp('/^\d\d\d\d-\d\d-\d\d$/', $info['date']); 31 | $this->assertTrue(false !== strtotime($info['date'])); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /_test/message.test.php: -------------------------------------------------------------------------------- 1 | assertEquals($expect, $message->toString()); 53 | 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /action.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | 9 | // must be run within Dokuwiki 10 | if(!defined('DOKU_INC')) die(); 11 | 12 | class action_plugin_smtp extends DokuWiki_Action_Plugin { 13 | 14 | /** 15 | * Registers a callback function for a given event 16 | * 17 | * @param Doku_Event_Handler $controller DokuWiki's event controller object 18 | * @return void 19 | */ 20 | public function register(Doku_Event_Handler $controller) { 21 | 22 | $controller->register_hook('MAIL_MESSAGE_SEND', 'BEFORE', $this, 'handle_mail_message_send'); 23 | 24 | } 25 | 26 | /** 27 | * [Custom event handler which performs action] 28 | * 29 | * @param Doku_Event $event event object by reference 30 | * @param mixed $param [the parameters passed as fifth argument to register_hook() when this 31 | * handler was registered] 32 | * @return void 33 | */ 34 | 35 | public function handle_mail_message_send(Doku_Event &$event, $param) { 36 | require_once __DIR__ . '/loader.php'; 37 | 38 | // prepare the message 39 | /** @var Mailer $mailer Our Mailer with all the data */ 40 | $mailer = $event->data['mail']; 41 | $body = $mailer->dump(); // this also prepares all internal variables of the mailer 42 | $rcpt = $event->data['to'] . ',' . 43 | $event->data['cc'] . ',' . 44 | $event->data['bcc']; 45 | $from = $event->data['from']; 46 | $message = new \splitbrain\dokuwiki\plugin\smtp\Message( 47 | $from, 48 | $rcpt, 49 | $body 50 | ); 51 | 52 | // prepare the SMTP communication lib 53 | $logger = new \splitbrain\dokuwiki\plugin\smtp\Logger(); 54 | $smtp = new \Tx\Mailer\SMTP($logger); 55 | $smtp->setServer( 56 | $this->getConf('smtp_host'), 57 | $this->getConf('smtp_port'), 58 | $this->getConf('smtp_ssl') 59 | ); 60 | if($this->getConf('auth_user')){ 61 | $smtp->setAuth( 62 | $this->getConf('auth_user'), 63 | $this->getConf('auth_pass') 64 | ); 65 | } 66 | $smtp->setEhlo( 67 | helper_plugin_smtp::getEHLO($this->getConf('localdomain')) 68 | ); 69 | 70 | 71 | // send the message 72 | try { 73 | $smtp->send($message); 74 | $ok = true; 75 | } catch (Exception $e) { 76 | msg('There was an unexpected problem communicating with SMTP: '.$e->getMessage(), -1); 77 | $ok = false; 78 | } 79 | 80 | // give debugging help on error 81 | if(!$ok && $this->getConf('debug')) { 82 | $log = array(); 83 | foreach($logger->getLog() as $line) { 84 | $log[] = trim($line[1]); 85 | } 86 | $log = trim(join("\n", $log)); 87 | msg('SMTP log:
'.hsc($log).'
Above may contain passwords - do not post online!',-1); 88 | } 89 | 90 | // finish event handling 91 | $event->preventDefault(); 92 | $event->stopPropagation(); 93 | $event->result = $ok; 94 | $event->data['success'] = $ok; 95 | } 96 | 97 | } 98 | 99 | // vim:ts=4:sw=4:et: 100 | -------------------------------------------------------------------------------- /admin.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | // must be run within Dokuwiki 9 | if(!defined('DOKU_INC')) die(); 10 | 11 | class admin_plugin_smtp extends DokuWiki_Admin_Plugin { 12 | 13 | /** 14 | * return sort order for position in admin menu 15 | */ 16 | function getMenuSort() { 17 | return 200; 18 | } 19 | 20 | /** 21 | * handle user request 22 | */ 23 | function handle() { 24 | global $INPUT; 25 | global $conf; 26 | if(!$INPUT->bool('send')) return; 27 | 28 | // make sure debugging is on; 29 | $conf['plugin']['smtp']['debug'] = 1; 30 | 31 | // send a mail 32 | $mail = new Mailer(); 33 | if($INPUT->str('to')) $mail->to($INPUT->str('to')); 34 | if($INPUT->str('cc')) $mail->cc($INPUT->str('cc')); 35 | if($INPUT->str('bcc')) $mail->bcc($INPUT->str('bcc')); 36 | $mail->subject('DokuWiki says hello'); 37 | $mail->setBody("Hi @USER@\n\nThis is a test from @DOKUWIKIURL@"); 38 | $ok = $mail->send(); 39 | 40 | // check result 41 | if($ok){ 42 | msg('Message was sent. SMTP seems to work.',1); 43 | }else{ 44 | msg('Message wasn\'t sent. SMTP seems not to work properly.',-1); 45 | } 46 | } 47 | 48 | /** 49 | * Output HTML form 50 | */ 51 | function html() { 52 | global $INPUT; 53 | global $conf; 54 | 55 | echo $this->locale_xhtml('intro'); 56 | 57 | if(!$conf['mailfrom']) msg($this->getLang('nofrom'),-1); 58 | 59 | 60 | $form = new Doku_Form(array()); 61 | $form->startFieldset('Testmail'); 62 | $form->addHidden('send', 1); 63 | $form->addElement(form_makeField('text', 'to', $INPUT->str('to'), 'To:', '', 'block')); 64 | $form->addElement(form_makeField('text', 'cc', $INPUT->str('cc'), 'Cc:', '', 'block')); 65 | $form->addElement(form_makeField('text', 'bcc', $INPUT->str('bcc'), 'Bcc:', '', 'block')); 66 | $form->addElement(form_makeButton('submit', '', 'Send Email')); 67 | 68 | $form->printForm(); 69 | } 70 | 71 | } 72 | -------------------------------------------------------------------------------- /admin.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /classes/Logger.php: -------------------------------------------------------------------------------- 1 | log; 25 | } 26 | 27 | /** 28 | * System is unusable. 29 | * 30 | * @param string $message 31 | * @param array $context 32 | * 33 | * @return null 34 | */ 35 | public function emergency($message, array $context = array()) 36 | { 37 | $this->log('emergency', $message, $context); 38 | } 39 | 40 | /** 41 | * Action must be taken immediately. 42 | * 43 | * Example: Entire website down, database unavailable, etc. This should 44 | * trigger the SMS alerts and wake you up. 45 | * 46 | * @param string $message 47 | * @param array $context 48 | * 49 | * @return null 50 | */ 51 | public function alert($message, array $context = array()) 52 | { 53 | $this->log('alert', $message, $context); 54 | } 55 | 56 | /** 57 | * Critical conditions. 58 | * 59 | * Example: Application component unavailable, unexpected exception. 60 | * 61 | * @param string $message 62 | * @param array $context 63 | * 64 | * @return null 65 | */ 66 | public function critical($message, array $context = array()) 67 | { 68 | $this->log('critical', $message, $context); 69 | } 70 | 71 | /** 72 | * Runtime errors that do not require immediate action but should typically 73 | * be logged and monitored. 74 | * 75 | * @param string $message 76 | * @param array $context 77 | * 78 | * @return null 79 | */ 80 | public function error($message, array $context = array()) 81 | { 82 | $this->log('error', $message, $context); 83 | } 84 | 85 | /** 86 | * Exceptional occurrences that are not errors. 87 | * 88 | * Example: Use of deprecated APIs, poor use of an API, undesirable things 89 | * that are not necessarily wrong. 90 | * 91 | * @param string $message 92 | * @param array $context 93 | * 94 | * @return null 95 | */ 96 | public function warning($message, array $context = array()) 97 | { 98 | $this->log('warning', $message, $context); 99 | } 100 | 101 | /** 102 | * Normal but significant events. 103 | * 104 | * @param string $message 105 | * @param array $context 106 | * 107 | * @return null 108 | */ 109 | public function notice($message, array $context = array()) 110 | { 111 | $this->log('notice', $message, $context); 112 | } 113 | 114 | /** 115 | * Interesting events. 116 | * 117 | * Example: User logs in, SQL logs. 118 | * 119 | * @param string $message 120 | * @param array $context 121 | * 122 | * @return null 123 | */ 124 | public function info($message, array $context = array()) 125 | { 126 | $this->log('info', $message, $context); 127 | } 128 | 129 | /** 130 | * Detailed debug information. 131 | * 132 | * @param string $message 133 | * @param array $context 134 | * 135 | * @return null 136 | */ 137 | public function debug($message, array $context = array()) 138 | { 139 | $this->log('debug', $message, $context); 140 | } 141 | 142 | /** 143 | * Logs with an arbitrary level. 144 | * 145 | * @param mixed $level 146 | * @param string $message 147 | * @param array $context 148 | * 149 | * @return null 150 | */ 151 | public function log($level, $message, array $context = array()) 152 | { 153 | $this->log[] = array($level, $message, $context); 154 | } 155 | } 156 | -------------------------------------------------------------------------------- /classes/Message.php: -------------------------------------------------------------------------------- 1 | from = $from; 26 | $this->rcpt = $rcpt; 27 | $this->body = $body; 28 | } 29 | 30 | /** 31 | * Return the mail only part of the from address 32 | * 33 | * @return string 34 | */ 35 | public function getFromEmail() { 36 | if(preg_match('#(.*?)<(.*?)>#', $this->from, $matches)) { 37 | return $matches[2]; 38 | } 39 | 40 | return $this->from; 41 | } 42 | 43 | /** 44 | * Get a list of all recipients (mail only part) 45 | * 46 | * @return array 47 | */ 48 | public function getTo() { 49 | $rcpt = array(); 50 | 51 | // We need the mail only part of all recipients 52 | $addresses = explode(',', $this->rcpt); 53 | foreach($addresses as $addr) { 54 | // parse address 55 | if(preg_match('#(.*?)<(.*?)>#', $addr, $matches)) { 56 | $rcpt[] = trim($matches[2]); 57 | } else { 58 | $rcpt[] = trim($addr); 59 | } 60 | } 61 | 62 | $rcpt = array_filter($rcpt); 63 | $rcpt = array_unique($rcpt); 64 | return $rcpt; 65 | } 66 | 67 | /** 68 | * Return the whole message body ready to be send by DATA 69 | * 70 | * Includes end of data signature and strips the BCC header 71 | * 72 | * @return string 73 | */ 74 | public function toString() { 75 | // we need to remove the BCC header here 76 | $lines = preg_split('/\r?\n/', $this->body); 77 | $count = count($lines); 78 | for($i=0; $i<$count; $i++) { 79 | if(trim($lines[$i]) === '') break; // end of headers, we're done 80 | if(substr($lines[$i],0, 4) == 'Bcc:') { 81 | unset($lines[$i]); // we found the Bcc: header and remove it 82 | while(substr($lines[++$i],0, 1) === ' ') { 83 | unset($lines[$i]); // indented lines are header continuation 84 | } 85 | break; // header removed, we're done 86 | } 87 | } 88 | $body = join($this->CRLF, $lines); 89 | 90 | return $body . $this->CRLF . $this->CRLF . "." . $this->CRLF; 91 | } 92 | 93 | } 94 | -------------------------------------------------------------------------------- /conf/default.php: -------------------------------------------------------------------------------- 1 | array('','ssl','tls')); 6 | 7 | $meta['auth_user'] = array('string'); 8 | $meta['auth_pass'] = array('password'); 9 | 10 | $meta['localdomain'] = array('string'); 11 | 12 | $meta['debug'] = array('onoff'); 13 | 14 | -------------------------------------------------------------------------------- /helper.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | 9 | // must be run within Dokuwiki 10 | if(!defined('DOKU_INC')) die(); 11 | 12 | class helper_plugin_smtp extends DokuWiki_Plugin { 13 | 14 | /** 15 | * Return a string usable as EHLO message 16 | * 17 | * @param string $ehlo configured EHLO (ovverrides automatic detection) 18 | * @return string 19 | */ 20 | static public function getEHLO($ehlo='') { 21 | if(empty($ehlo)) { 22 | $ip = $_SERVER["SERVER_ADDR"]; 23 | if (empty($ip)) 24 | return "localhost.localdomain"; 25 | 26 | // Indicate IPv6 address according to RFC 2821, if applicable. 27 | $colonPos = strpos($ip, ':'); 28 | if ($colonPos !== false) { 29 | $ip = 'IPv6:'.$ip; 30 | } 31 | 32 | return "[" . $ip . "]"; 33 | } 34 | return $ehlo; 35 | } 36 | 37 | } 38 | 39 | // vim:ts=4:sw=4:et: 40 | -------------------------------------------------------------------------------- /lang/ar/intro.txt: -------------------------------------------------------------------------------- 1 | = = = اختبار سويفتميل = = = هذه الصفحة يسمح لك بتشغيل إرسال بريد اختبار في دوكي ويكي. يمكنك استخدامه للتحقق إذا قمت بتكوين البرنامج المساعد سويفتميل بشكل صحيح. إعطاء عناوين البريد الإلكتروني الخاص بالمستلم في النموذج أدناه. -------------------------------------------------------------------------------- /lang/ar/lang.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | $lang['menu'] = 'تحقق من تكوين سويفتميل'; 9 | $lang['nofrom'] = 'أنت لم تكوين الخيار \'mailfrom\'. إرسال الرسائل ستفشل على الأرجح.'; 10 | -------------------------------------------------------------------------------- /lang/ar/settings.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | $lang['smtp_host'] = 'خادم البريد الصادر SMTP.'; 9 | $lang['smtp_ssl'] = 'ما هو نوع التشفير المستخدم عند الاتصال مع ملقم SMTP الخاص بك؟'; 10 | $lang['smtp_ssl_o_'] = 'لا شيء'; 11 | $lang['auth_user'] = 'إذا كانت المصادقة مطلوبة، ضع اسم المستخدم الخاص بك هنا.'; 12 | $lang['auth_pass'] = 'كلمة المرور للمستخدم أعلاه.'; 13 | $lang['debug'] = 'طباعة سجل كامل للاخطأ عند فشل الإرسال؟ تعطيل عندما يعمل كل شيء!'; 14 | -------------------------------------------------------------------------------- /lang/cs/intro.txt: -------------------------------------------------------------------------------- 1 | ====== Zkouška SMTP ====== 2 | 3 | Na této stránce můžete vyzkoušet posílání e-mailu v DokuWiki. Můžete ji využít pro ověření správnosti nastavení rozšíření SMTP. 4 | 5 | Do formuláře níže zadejte e-mailové adresy adresátů. -------------------------------------------------------------------------------- /lang/cs/lang.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | $lang['menu'] = 'Zkouška nastavení SMTP'; 9 | $lang['nofrom'] = 'Nenastavili jste možnost \'mailfrom\'. Odesílání e-mailů pravděpodobně selže.'; 10 | -------------------------------------------------------------------------------- /lang/cs/settings.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | $lang['smtp_host'] = 'Váš odchozí SMTP server.'; 9 | $lang['smtp_port'] = 'Port, na kterém SMTP server naslouchá. Obvykle 25. 465 pro SSL.'; 10 | $lang['smtp_ssl'] = 'Jaký typ šifrování se využívá pro komunikaci s vaším SMTP serverem?'; 11 | $lang['smtp_ssl_o_'] = 'žádný'; 12 | $lang['smtp_ssl_o_ssl'] = 'SSL'; 13 | $lang['smtp_ssl_o_tls'] = 'TLS'; 14 | $lang['auth_user'] = 'Pokud je vyžadováno ověření, zadejte sem uživatelské jméno.'; 15 | $lang['auth_pass'] = 'Heslo pro výše uvedeného uživatele.'; 16 | $lang['localdomain'] = 'Jméno, které má být použito během HELO fáze SMTP. Mělo by být FQDN webového serveru, na kterém běží DokuWiki. Pro automatické zjištění ponechte prázdné.'; 17 | $lang['debug'] = 'Vypsat kompletní výpis chyb, pokud odesílání selže? Zrušte, pokud vše funguje!'; 18 | -------------------------------------------------------------------------------- /lang/da/intro.txt: -------------------------------------------------------------------------------- 1 | ====== SMTP Test ====== 2 | 3 | Denne side tillader dig at udløse sending af en test-mail i DokuWiki. Du kan bruge den til at kontrollere om du har konfigureret SMTP plugin korrekt. 4 | 5 | Angiv modtagers email-adresse i formularen herunder. 6 | -------------------------------------------------------------------------------- /lang/da/lang.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | $lang['menu'] = 'Kontrollér SMTP konfiguration'; 9 | $lang['nofrom'] = 'Du konfigurerede ikke \'mailfrom\'-indstillingen. Sending af mails vil højst sandsynligt fejle.'; 10 | -------------------------------------------------------------------------------- /lang/da/settings.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | $lang['smtp_host'] = 'Din udgående SMTP-server.'; 9 | $lang['smtp_port'] = 'Porten, hvor din SMTP-server lytter. Som regel 25. 465 for SSL.'; 10 | $lang['smtp_ssl'] = 'Hvilken kryptering benyttes under kommunikation med din SMTP-Server?'; 11 | $lang['smtp_ssl_o_'] = 'ingen'; 12 | $lang['smtp_ssl_o_ssl'] = 'SSL'; 13 | $lang['smtp_ssl_o_tls'] = 'TLS'; 14 | $lang['auth_user'] = 'Hvis autentificering er nødvendigt, skriv dit brugernavn her.'; 15 | $lang['auth_pass'] = 'Adgangskode for brugeren herover.'; 16 | $lang['localdomain'] = 'Navnet der skal benyttes under HELP-fasen for SMTP. Bør være FQDN for webserveren som DokuWiki kører på. Efterlad feltet tomt for autogenkendelse.'; 17 | $lang['debug'] = 'Udskriv en fuld fejllog når mails sendes? Deaktivér dette, når alt virker!'; 18 | -------------------------------------------------------------------------------- /lang/de-informal/intro.txt: -------------------------------------------------------------------------------- 1 | ====== SMTP Test ====== 2 | 3 | Auf dieser Seite kannst Du eine Testmail über DokuWiki versenden, um die aktuelle SMTP Konfiguration zu überprüfen. 4 | 5 | Bitte gebe die entsprechenden E-Mail-Adressen der Empfänger in das Formular ein. -------------------------------------------------------------------------------- /lang/de-informal/lang.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | $lang['menu'] = 'SMTP Konfiguration überprüfen'; 9 | $lang['nofrom'] = 'Du hast die "mailfrom" Option nicht gesetzt. Der E-Mail Versand wird deshalb vermutlich fehlschlagen.'; 10 | -------------------------------------------------------------------------------- /lang/de-informal/settings.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | $lang['smtp_host'] = 'Dein Mail-Ausgangserver'; 9 | $lang['smtp_port'] = 'Port Deines SMTP Servers (Standard 25 oder 465 für SSL)'; 10 | $lang['smtp_ssl'] = 'Welche Verschlüsselung wird bei der Kommunikation mit Deinem SMTP-Server verwendet?'; 11 | $lang['smtp_ssl_o_'] = 'keine'; 12 | $lang['smtp_ssl_o_ssl'] = 'SSL'; 13 | $lang['smtp_ssl_o_tls'] = 'TLS'; 14 | $lang['auth_user'] = 'Trage hier den Benutzernamen ein, falls eine Anmeldung am SMTP Server erforderlich ist.'; 15 | $lang['auth_pass'] = 'Password für den obenstehenden Benutzer'; 16 | $lang['localdomain'] = 'Füge hier den Namen ein, welcher während des HELO Aufrufes von SMTP verwendet werden soll. Dies sollte der FQDN deines DokuWiki-Webservers sein. Wenn das Feld leer gelassen wird, wird DokuWiki versuchen es selbst zu ermitteln.'; 17 | $lang['debug'] = 'Kompletten Fehlerbericht ausgeben wenn das Versenden fehlschlägt. Deaktivieren, sobald das Versenden funktioniert!'; 18 | -------------------------------------------------------------------------------- /lang/de/intro.txt: -------------------------------------------------------------------------------- 1 | ====== SMTP Test ====== 2 | 3 | Auf dieser Seite können Sie eine Testmail über DokuWiki versenden, um die aktuelle SMTP Konfiguration zu überprüfen. 4 | 5 | Bitte geben Sie die entsprechenden E-Mail-Adressen der Empfänger in das Formular ein. 6 | -------------------------------------------------------------------------------- /lang/de/lang.php: -------------------------------------------------------------------------------- 1 | 7 | * @author Dominik Eckelmann 8 | */ 9 | $lang['menu'] = 'SMTP Konfiguration überprüfen'; 10 | $lang['nofrom'] = 'Sie haben die "mailfrom" Option nicht gesetzt. Der E-Mail Versand wird deshalb vermutlich fehlschlagen.'; 11 | -------------------------------------------------------------------------------- /lang/de/settings.php: -------------------------------------------------------------------------------- 1 | 7 | * @author Dominik Eckelmann 8 | */ 9 | $lang['smtp_host'] = 'Ihr ausgehender SMTP Server'; 10 | $lang['smtp_port'] = 'Der Port Ihres SMTP Servers (Standard 25 oder 465 für SSL)'; 11 | $lang['smtp_ssl'] = 'Welche Verschlüsslung wird bei der Kommunikation mit dem SMTP Server verwendet?'; 12 | $lang['smtp_ssl_o_'] = 'Keine'; 13 | $lang['smtp_ssl_o_ssl'] = 'SSL'; 14 | $lang['smtp_ssl_o_tls'] = 'TLS'; 15 | $lang['auth_user'] = 'Tragen Sie hier den Benutzernamen ein, falls eine Anmeldung am SMTP Server erforderlich ist.'; 16 | $lang['auth_pass'] = 'Passwort für den obenstehenden Benutzer.'; 17 | $lang['localdomain'] = 'Fügen Sie hier den Namen ein, welcher während des HELO Aufrufes von SMTP verwendet werden soll. Dies sollte der FQDN Ihres DokuWiki Webservers sein. Wenn das Feld leer gelassen wird, wird DokuWiki versuchen es selbst zu ermitteln.'; 18 | $lang['debug'] = 'Kompletten Fehlerbericht ausgeben wenn das Versenden fehlschlägt. Deaktiviere sobald das Versenden funktioniert!'; 19 | -------------------------------------------------------------------------------- /lang/en/intro.txt: -------------------------------------------------------------------------------- 1 | ====== SMTP Testing ====== 2 | 3 | This page allows you to trigger sending a test mail in DokuWiki. You can use it to check if you configured the SMTP plugin correctly. 4 | 5 | Give recipient's email addresses in the form below. 6 | -------------------------------------------------------------------------------- /lang/en/lang.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | $lang['menu'] = 'Testi la agordojn de SMTP'; 9 | $lang['nofrom'] = 'Vi ne indikis la \'mailfrom\'-opcion. Sendi retpoŝtaĵojn verŝajne malsukcesos.'; 10 | -------------------------------------------------------------------------------- /lang/eo/settings.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | $lang['smtp_host'] = 'Via SMTP-servilo por eliranta poŝto.'; 9 | $lang['smtp_port'] = 'La SMTP-pordego de via servilo. Kutime 25, 465 por SSL.'; 10 | $lang['smtp_ssl'] = 'Kia ĉifrado estas uzata dum komunikado kun via SMTP-servilo?'; 11 | $lang['smtp_ssl_o_'] = 'neniu'; 12 | $lang['smtp_ssl_o_ssl'] = 'SSL'; 13 | $lang['smtp_ssl_o_tls'] = 'TLS'; 14 | $lang['auth_user'] = 'Se aŭtentikado necesas, indiku vian nomon tie.'; 15 | $lang['auth_pass'] = 'Pasvorto por la supra uzanto.'; 16 | $lang['localdomain'] = 'Nomo dum la HELO-fazo de SMTP. Devus esti la FQDN de la retservilo, kiun uzas DokuWiki. Lasu malplena por aŭtomata detekto.'; 17 | $lang['debug'] = 'Ĉu presi plenan erar-logon, kiam sendado malsukcesas? Malŝaltu, kiam ĉio funkcias!'; 18 | -------------------------------------------------------------------------------- /lang/es/intro.txt: -------------------------------------------------------------------------------- 1 | ====== Probando SMTP ====== 2 | 3 | Esta página permite iniciar el envío de un correo de prueba en DokuWiki. Puedes usarlo para verificar que el módulo de programa SMTP esté configurado correctamente. 4 | 5 | Anota las direcciones de correo electrónico de recepción en la forma siguiente. -------------------------------------------------------------------------------- /lang/es/lang.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | $lang['menu'] = 'Verifica la configuración SMTP'; 9 | $lang['nofrom'] = 'No configuraste la opción "correo de envío". Probablemente fallará el envío de correos electrónicos.'; 10 | -------------------------------------------------------------------------------- /lang/es/settings.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | $lang['smtp_host'] = 'Servidor de SMTP saliente.'; 9 | $lang['smtp_port'] = 'El puerto de escucha del servidor SMTP. Usualmente 25. 465 para SSL'; 10 | $lang['smtp_ssl'] = '¿Qué tipo de cifrado se utiliza para comunicarse con el servidor SMTP?'; 11 | $lang['smtp_ssl_o_'] = 'ninguno'; 12 | $lang['smtp_ssl_o_ssl'] = 'SSL'; 13 | $lang['smtp_ssl_o_tls'] = 'TLS'; 14 | $lang['auth_user'] = 'Si requiere autenticación, escriba el nombre de usuario aquí'; 15 | $lang['auth_pass'] = 'Contraseña para el usuario anterior'; 16 | $lang['localdomain'] = 'El nombre usado durante la fase HELO de SMTP. Debe ser la FWDN del servidor web en el que está ejecutándose DokuWiki. Deje en blanco para autodetección.'; 17 | $lang['debug'] = '¿Se imprime una bitácora de error completa cuando falle el envío? ¡Deshabilite cuando todo funcione!'; 18 | -------------------------------------------------------------------------------- /lang/fr/intro.txt: -------------------------------------------------------------------------------- 1 | ====== Test de SMTP ====== 2 | 3 | Cette page vous permet de déclencher l'envoi d'un courriel de test depuis DokuWiki. Vous pouvez l'utiliser pour vérifier si SMTP est correctement configuré. 4 | 5 | Indiquez l'adresse email du destinataire dans le formulaire ci dessous. 6 | -------------------------------------------------------------------------------- /lang/fr/lang.php: -------------------------------------------------------------------------------- 1 | 7 | * @author Schplurtz le Déboulonné 8 | */ 9 | $lang['menu'] = 'Vérifier la configuration de SMTP'; 10 | $lang['nofrom'] = 'Vous n\'avez pas configuré l\'option \'De\'. L\'envoi de courriel va probablement échouer.'; 11 | -------------------------------------------------------------------------------- /lang/fr/settings.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | $lang['smtp_host'] = 'Votre serveur SMTP sortant.'; 9 | $lang['smtp_port'] = 'Port d\'écoute du serveur SMTP. Habituellement 25. 465 pour SSL'; 10 | $lang['smtp_ssl'] = 'Type de chiffrement utilisé lors des communications avec votre serveur SMTP.'; 11 | $lang['smtp_ssl_o_'] = 'aucun'; 12 | $lang['smtp_ssl_o_ssl'] = 'SSL'; 13 | $lang['smtp_ssl_o_tls'] = 'TLS'; 14 | $lang['auth_user'] = 'SI une authentification est nécessaire, indiquez ici le nom d\'utilisateur.'; 15 | $lang['auth_pass'] = 'Mot de passe du compte ci dessus.'; 16 | $lang['localdomain'] = 'Nom à utiliser durant la phase HELO du protocole SMTP. Devrait être le FQDN du serveur web sur lequel DokuWiki fonctionne. Laisser vide pour une détection automatique.'; 17 | $lang['debug'] = 'Afficher un journal d\'erreur complet en cas d\'échec d\'envoi. Désactiver lorsque tout fonctionne.'; 18 | -------------------------------------------------------------------------------- /lang/ja/intro.txt: -------------------------------------------------------------------------------- 1 | ====== SMTP 設定の確認 ====== 2 | 3 | このページは、DokuWiki からのテストメール送信ができます。 4 | SMTP プラグインの設定が正しいかどうかの確認に使用してください。 5 | 6 | 宛先の電子メールアドレスを下のフォームに入力して下さい。 7 | -------------------------------------------------------------------------------- /lang/ja/lang.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | $lang['menu'] = 'SMTP 設定の確認'; 9 | $lang['nofrom'] = '\'mailfrom\' オプションを設定していません。メール送信は、おそらく失敗します。'; 10 | -------------------------------------------------------------------------------- /lang/ja/settings.php: -------------------------------------------------------------------------------- 1 | 7 | * @author hideaki SAWADA 8 | */ 9 | $lang['smtp_host'] = '送信 SMTP サーバー'; 10 | $lang['smtp_port'] = 'SMTP サーバーのポート。通常は 25。SSL の場合は 465。'; 11 | $lang['smtp_ssl'] = 'SMTP サーバーと通信する時、使用される暗号化は?'; 12 | $lang['smtp_ssl_o_'] = 'なし'; 13 | $lang['smtp_ssl_o_ssl'] = 'SSL'; 14 | $lang['smtp_ssl_o_tls'] = 'TLS'; 15 | $lang['auth_user'] = '認証が必要な場合のユーザー名'; 16 | $lang['auth_pass'] = '上記ユーザーのパスワード'; 17 | $lang['localdomain'] = 'SMTP の HELO フェーズ中に使用される名前。DokuWiki が稼働している Web サーバーの FQDN です。自動検出させる場合、空のままにします。'; 18 | $lang['debug'] = '送信が失敗した場合、完全なエラーログを印刷しますか?稼働確認後、無効にして下さい!'; 19 | -------------------------------------------------------------------------------- /lang/ko/intro.txt: -------------------------------------------------------------------------------- 1 | ====== SMTP 테스트 ====== 2 | 3 | 이 페이지는 도쿠위키에서 테스트 메일을 보낼 수 있습니다. 올바르게 SMTP 플러그인을 설정했는지 확인하는 데 사용할 수 있습니다. 4 | 5 | 아래 양식에서 받는 사람의 이메일 주소를 주세요. 6 | -------------------------------------------------------------------------------- /lang/ko/lang.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | $lang['menu'] = 'SMTP 설정 확인'; 9 | $lang['nofrom'] = '\'mailfrom\' 옵션이 설정되지 않았습니다. 메일 보내기는 아마 실패할 것입니다.'; 10 | -------------------------------------------------------------------------------- /lang/ko/settings.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | $lang['smtp_host'] = '보내는 SMTP 서버.'; 9 | $lang['smtp_port'] = '수신 대기하는 SMTP 서버 포트. 일반적으로 25. SSL은 465.'; 10 | $lang['smtp_ssl'] = 'SMTP 서버와 통신할 때 어떤 종류의 암호화를 사용합니까?'; 11 | $lang['smtp_ssl_o_'] = '없음'; 12 | $lang['smtp_ssl_o_ssl'] = 'SSL'; 13 | $lang['smtp_ssl_o_tls'] = 'TLS'; 14 | $lang['auth_user'] = '인증이 필요하면, 여기에 사용자 이름을 넣으세요.'; 15 | $lang['auth_pass'] = '위 사용자에 대한 비밀번호.'; 16 | $lang['localdomain'] = 'SMTP의 HELO 단계에서 사용될 이름. 도쿠위키를 실행하고 있는 웹 서버가 정규화된 도메인 이름(HELO)이어야 합니다. 자동 감지를 하려면 비워 두세요.'; 17 | $lang['debug'] = '보내기를 실패할 때 전체 오류 기록을 인쇄하겠습니까? 모든 작동이 정상이면 비활성화하세요!'; 18 | -------------------------------------------------------------------------------- /lang/nl/intro.txt: -------------------------------------------------------------------------------- 1 | ====== SMTP Test ====== 2 | 3 | Deze pagina laat je een test e-mail versturen in DokuWiki. Je kunt het gebruiken om te controleren of je de SMTP plugin correct hebt geconfigureerd. 4 | 5 | Geef een e-mailadres waarop u het bericht wilt ontvangen in het formulier hieronder. 6 | -------------------------------------------------------------------------------- /lang/nl/lang.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | $lang['menu'] = 'SMTP configuratie controleren'; 9 | $lang['nofrom'] = 'Je hebt niet de \'mailfrom\' optie geconfigureerd. Het versturen van e-mail zal waarschijnlijk mislukken.'; 10 | -------------------------------------------------------------------------------- /lang/nl/settings.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | $lang['smtp_host'] = 'Je uitgaande SMTP server.'; 9 | $lang['smtp_port'] = 'De poort waarop je SMTP server luistert. Vaak 25. 465 voor SSL.'; 10 | $lang['smtp_ssl'] = 'Welke soort encryptie is gebruikt om te communiceren met je SMTP server?'; 11 | $lang['smtp_ssl_o_'] = 'geen'; 12 | $lang['smtp_ssl_o_ssl'] = 'SSL'; 13 | $lang['smtp_ssl_o_tls'] = 'TLS'; 14 | $lang['auth_user'] = 'Als authenticatie nodig is, moet je hier je gebruikersnaam geven.'; 15 | $lang['auth_pass'] = 'Wachtwoord van bovenstaande gebruiker.'; 16 | $lang['localdomain'] = 'De naam die gebruikt wordt tijdens de HELO fase van SMTP. Moet de FQDN van de webserver zijn waarop DokuWiki draait. Leeglaten voor zelfdetectie.'; 17 | $lang['debug'] = 'Een complete foutlog weergeven als het versturen mislukt? Schakel deze optie uit als alles werkt!'; 18 | -------------------------------------------------------------------------------- /lang/no/intro.txt: -------------------------------------------------------------------------------- 1 | ====== SMTP-testing ====== 2 | 3 | På denne siden kan du sende ut en test-e-post fra DokuWiki. Bruk denne for å sjekke om du har installert din SMTP-utvidelse riktig. 4 | 5 | Sett inn mottakers e-postadresse i skjemaet nedenfor. 6 | -------------------------------------------------------------------------------- /lang/no/lang.php: -------------------------------------------------------------------------------- 1 | 7 | * @author Arne Hanssen 8 | */ 9 | $lang['menu'] = 'Sjekk SMTP-konfigurasjonen'; 10 | $lang['nofrom'] = 'Du har ikke konfigurerte «Avsenderadresse for automatiske e-poster». Sending av e-post vil sannsynligvis ikke virke.'; 11 | -------------------------------------------------------------------------------- /lang/no/settings.php: -------------------------------------------------------------------------------- 1 | 7 | * @author Arne Hanssen 8 | */ 9 | $lang['smtp_host'] = 'Utgående SMTP-server.'; 10 | $lang['smtp_port'] = 'Porten din SMTP-server lytter til. Vanligvis port 25. Port 465 brukes ved SSL.'; 11 | $lang['smtp_ssl'] = 'Hvilken type kryptering brukes ved kommunikasjon med SMTP-serveren?'; 12 | $lang['smtp_ssl_o_'] = 'ingen'; 13 | $lang['smtp_ssl_o_ssl'] = 'SSL'; 14 | $lang['smtp_ssl_o_tls'] = 'TLS'; 15 | $lang['auth_user'] = 'Hvis autentisering er påkrevd, skriv inn brukernavnet ditt her.'; 16 | $lang['auth_pass'] = 'Passord for brukeren over.'; 17 | $lang['localdomain'] = 'Navnet som vil bli brukt HELO fasen av SMTP. Bør være kjørende DokuWiki-serverens FQDN (komplette domenenavn) . La feltet være blankt for autodeteksjon. '; 18 | $lang['debug'] = 'Vise full feillogg når sending av e-post feiler? Deaktiver når alt fungerer!'; 19 | -------------------------------------------------------------------------------- /lang/pl/intro.txt: -------------------------------------------------------------------------------- 1 | ====== Testowanie SMTP ====== 2 | 3 | Ta strona umożliwia wysyłanie testowej wiadomości e-mail w DokuWiki. Możesz go użyć do sprawdzenia, czy poprawnie skonfigurowałeś wtyczkę SMTP. 4 | 5 | Podaj adresy e-mail odbiorcy w poniższym formularzu. -------------------------------------------------------------------------------- /lang/pl/lang.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | $lang['menu'] = 'Sprawdź konfigurację SMTP'; 9 | $lang['nofrom'] = 'Nie uzupełniłeś pola „OD (Nadawca)”. Wysyłanie maili prawdopodobnie się nie powiedzie.'; 10 | -------------------------------------------------------------------------------- /lang/pl/settings.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | $lang['smtp_host'] = 'Twój serwer poczty wychodzącej SMTP'; 9 | $lang['smtp_port'] = 'Port serwera SMTP. Zazwyczaj 25. 465 dla SSL'; 10 | $lang['smtp_ssl'] = 'Jakie szyfrowanie jest używane podczas komunikacji z serwerem SMTP?'; 11 | $lang['smtp_ssl_o_'] = 'brak'; 12 | $lang['smtp_ssl_o_ssl'] = 'SSL'; 13 | $lang['smtp_ssl_o_tls'] = 'TLS'; 14 | $lang['auth_user'] = 'Jeśli wymagana jest autoryzacja, podaj nazwę użytkownika'; 15 | $lang['auth_pass'] = 'Hasło dla powyższego użytkownika'; 16 | $lang['localdomain'] = 'Nazwa, która będzie używana podczas fazy HELO SMTP. Powinna być nazwą FQDN serwera WWW, na którym działa DokuWiki. Pozostaw puste do automatycznego wykrywania.'; 17 | $lang['debug'] = 'Wyświetlić pełny dziennik błędów, gdy wysyłanie nie powiedzie się? Wyłącz, gdy wszystko działa poprawnie!'; 18 | -------------------------------------------------------------------------------- /lang/pt-br/intro.txt: -------------------------------------------------------------------------------- 1 | ====== Teste de SMTP ====== 2 | 3 | Esta página permite acionar o envio de um e-mail de teste no DokuWiki. Você pode usá-lo para verificar se configurou o plug-in SMTP corretamente. Forneça os endereços de e-mail do destinatário no formulário abaixo. -------------------------------------------------------------------------------- /lang/pt-br/lang.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | $lang['menu'] = 'Verifique a configuração do SMTP'; 9 | $lang['nofrom'] = 'Você não configurou a opção \'mailfrom\'. O envio de e-mails provavelmente falhará.'; 10 | -------------------------------------------------------------------------------- /lang/pt-br/settings.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | $lang['smtp_host'] = 'Seu servidor SMTP de saída.'; 9 | $lang['smtp_port'] = 'A porta na qual seu servidor SMTP escuta. Normalmente 25.465 para SSL.'; 10 | $lang['smtp_ssl'] = 'Que tipo de criptografia é usada ao se comunicar com seu servidor SMTP?'; 11 | $lang['smtp_ssl_o_'] = 'nenhum'; 12 | $lang['smtp_ssl_o_ssl'] = 'SSL'; 13 | $lang['smtp_ssl_o_tls'] = 'TLS'; 14 | $lang['auth_user'] = 'Se a autenticação for necessária, coloque seu nome de usuário aqui.'; 15 | $lang['auth_pass'] = 'Senha para o usuário acima.'; 16 | $lang['localdomain'] = 'O nome a ser usado durante a fase HELO do SMTP. Deve ser o FQDN do servidor web em que o DokuWiki está sendo executado. Deixe em branco para detecção automática.'; 17 | $lang['debug'] = 'Imprimir um log de erros completo quando o envio falha? Desative quando tudo funcionar!'; 18 | -------------------------------------------------------------------------------- /lang/ru/intro.txt: -------------------------------------------------------------------------------- 1 | ====== Проверка протокола SMTP ====== 2 | 3 | С этой странице вы можете отправить тестовое письмо из «Докувики», чтобы проверить правильность настроек плагина. 4 | 5 | Напишите адреса получателей электронной почты в форме ниже. -------------------------------------------------------------------------------- /lang/ru/lang.php: -------------------------------------------------------------------------------- 1 | 7 | * @author Artem Trutko 8 | */ 9 | $lang['menu'] = 'Проверка SMTP-конфигурации'; 10 | $lang['nofrom'] = 'Не указан параметр mailfrom в настройках вики. Отправка письма вряд ли получится.'; 11 | -------------------------------------------------------------------------------- /lang/ru/settings.php: -------------------------------------------------------------------------------- 1 | 7 | * @author Artem Trutko 8 | */ 9 | $lang['smtp_host'] = 'SMTP-сервер исходящей почты.'; 10 | $lang['smtp_port'] = 'Порт SMTP-сервера. Обычно 25. 465 для SSL.'; 11 | $lang['smtp_ssl'] = 'Какой тип шифрования используется при связи с SMTP-сервером?'; 12 | $lang['smtp_ssl_o_'] = 'ничего'; 13 | $lang['smtp_ssl_o_ssl'] = 'SSL'; 14 | $lang['smtp_ssl_o_tls'] = 'TLS'; 15 | $lang['auth_user'] = 'Если требуется проверка подлинности, укажите своё имя пользователя здесь.'; 16 | $lang['auth_pass'] = 'Пароль для указанного пользователя.'; 17 | $lang['localdomain'] = 'Имя, которое будет использоваться во время фазы запрос helo протокола SMTP. Должно быть полное доменное имя веб-сервера «Докувики». Оставьте пустым для автоопределения.'; 18 | $lang['debug'] = 'Отобразить полный журнал ошибок при сбое отправки? Отключите, когда всё работает!'; 19 | -------------------------------------------------------------------------------- /lang/sk/settings.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | 9 | $lang['smtp_host'] = 'Meno/adresa SMTP servera pre odosielanie pošty'; // eng: 'Your outgoing SMTP server.'; 10 | $lang['smtp_port'] = 'Číslo portu, na ktorom počúva SMTP server. Väčšinou 25, resp. 465 pre SSL.'; // eng: 'The port your SMTP server listens on. Usually 25. 465 for SSL.'; 11 | $lang['smtp_ssl'] = 'Typ šifrovania, ktorý sa používa pri komunikácii s SMTP serverom'; // eng: 'What kind of encryption is used when communicating with your SMTP Server?'; // off, ssl, tls 12 | 13 | $lang['smtp_ssl_o_'] = 'žiadne'; // eng: 'none'; 14 | $lang['smtp_ssl_o_ssl'] = 'SSL'; // eng: 'SSL'; 15 | $lang['smtp_ssl_o_tls'] = 'TLS'; // eng: 'TLS'; 16 | 17 | $lang['auth_user'] = 'Ak SMTP server vyžaduje autentifikáciu, použiť nasledovné meno používateľa'; // eng: 'If authentication is required, put your user name here.'; 18 | $lang['auth_pass'] = 'Ak SMTP server vyžaduje autentifikáciu, použiť nasledovné heslo používateľa'; // eng: 'Password for the above user.'; 19 | 20 | $lang['localdomain'] = 'Meno použité v HELO fáze SMTP. Malo by to byť FQDN webservera, na ktorom beží DokuWiki. Pre autodetekciu nechať pole prázdne.'; // eng: 'The name to be used during HELO phase of SMTP. Should be the FQDN of the webserver DokuWiki is running on. Leave empty for autodetection.'; 21 | 22 | $lang['debug'] = 'Zobraziť celý chybový log keď odosielanie zlyhá? Deaktivovať, ak všetko funguje!'; // eng: 'Print a full error log when sending fails? Disable when everything works!'; 23 | -------------------------------------------------------------------------------- /lang/sv/intro.txt: -------------------------------------------------------------------------------- 1 | ====== Test av SMTP ====== 2 | 3 | Denna sida tillåter dig att skicka ett test-e-brev via DokuWiki. Du kan använda sidan för att kontrollera om du konfigurerat SMTP korrekt. 4 | 5 | Fyll i mottagarens e-postadress i formuläret nedan. -------------------------------------------------------------------------------- /lang/sv/lang.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | $lang['menu'] = 'Kontrollera SMTP-konfiguration'; 9 | $lang['nofrom'] = 'Du konfigurerade inte \'mailform\'-alternativet. E-postutskick kommer troligen inte fungera.'; 10 | -------------------------------------------------------------------------------- /lang/sv/settings.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | $lang['smtp_host'] = 'Din utgående SMTP-server'; 9 | $lang['smtp_port'] = 'Porten som din SMTP-server lyssnar på. Vanligtvis 25. 465 för SSL.'; 10 | $lang['smtp_ssl'] = 'Vilken typ av kryptering används vid kommunikation med din SMTP-server?'; 11 | $lang['smtp_ssl_o_'] = 'ingen'; 12 | $lang['smtp_ssl_o_ssl'] = 'SSL'; 13 | $lang['smtp_ssl_o_tls'] = 'TLS'; 14 | $lang['auth_user'] = 'Om autentisering krävs, fyll i ditt användarnamn här'; 15 | $lang['auth_pass'] = 'Lösenord för ovanstående användare.'; 16 | $lang['localdomain'] = 'Namnet att använda för HELO-fasen av SMTP. Skall vara FQDN för webbservern som DokuWiki körs på. Lämna tomt för automatisk detektion.'; 17 | $lang['debug'] = 'Skriv en fullständig fellogg när utskick ej fungerar. Avaktivera när allt fungerar!'; 18 | -------------------------------------------------------------------------------- /lang/vi/intro.txt: -------------------------------------------------------------------------------- 1 | ====== Thử nghiệm SMTP ====== 2 | 3 | Trang này cho phép bạn kích hoạt gửi thư kiểm tra trong DokuWiki. Bạn có thể sử dụng nó để kiểm tra xem bạn đã định cấu hình đúng tiện ích plugin SMTP chưa. 4 | 5 | Cung cấp địa chỉ email của người nhận trong mẫu dưới đây. -------------------------------------------------------------------------------- /lang/vi/lang.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | $lang['menu'] = 'Kiểm tra cấu hình SMTP'; 9 | $lang['nofrom'] = 'Bạn đã không cấu hình tuỳ chọn \'thư tới từ\'. Việc gửi thư sẽ có thể thất bại'; 10 | -------------------------------------------------------------------------------- /lang/vi/settings.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | $lang['smtp_host'] = 'Máy chủ SMTP ra ngoài của bạn.'; 9 | $lang['smtp_port'] = 'Cổng của máy chủ SMTP của bạn đang lắng nghe. Thông thường là 25. 465 cho SSL.'; 10 | $lang['smtp_ssl'] = 'Kiểu mã hoá nào được sử dụng khi liên lạc với máy chủ SMTP của bạn?'; 11 | $lang['smtp_ssl_o_'] = 'trống'; 12 | $lang['smtp_ssl_o_ssl'] = 'SSL'; 13 | $lang['smtp_ssl_o_tls'] = 'TLS'; 14 | $lang['auth_user'] = 'Nếu việc xác thực được yêu cầu, nhập tên người dùng của bạn tại đây.'; 15 | $lang['auth_pass'] = 'Mật khẩu cho người dùng trên.'; 16 | $lang['localdomain'] = 'Tên được sử dụng trong pha HELO của SMTP. Nên là FQDN của máy chủ trang web DokuWiki đang được chạy trên. Hãy để trống cho tác vụ tự động phát hiện.'; 17 | $lang['debug'] = 'In một nhật ký log đầy đủ của lỗi khi gửi đi thất bại chứ? Tắt đi khi tất cả mọi thứ hoạt động bình thường!'; 18 | -------------------------------------------------------------------------------- /lang/zh/intro.txt: -------------------------------------------------------------------------------- 1 | ====== SMTP 测试 ====== 2 | 3 | 本页面允许您从 Dokuwiki 发送测试邮件。您可以用它来检查 SMTP 插件是否已正确配置。 4 | 5 | 在下面的表格中填入收件人的电子邮箱。 6 | -------------------------------------------------------------------------------- /lang/zh/lang.php: -------------------------------------------------------------------------------- 1 | __DIR__ . '/subtree/php-fig/log/Psr/Log/', 15 | 'Tx\\' => __DIR__ . '/subtree/txtthinking/Mailer/src/', 16 | 'splitbrain\\dokuwiki\\plugin\\smtp\\' => __DIR__ . '/classes/' 17 | ); 18 | 19 | foreach($namespaces as $prefix => $base_dir) { 20 | // does the class use the namespace prefix? 21 | $len = strlen($prefix); 22 | if (strncmp($prefix, $class, $len) !== 0) { 23 | // no, move to the next 24 | continue; 25 | } 26 | 27 | // get the relative class name 28 | $relative_class = substr($class, $len); 29 | 30 | // replace the namespace prefix with the base directory, replace namespace 31 | // separators with directory separators in the relative class name, append 32 | // with .php 33 | $file = $base_dir . str_replace('\\', '/', $relative_class) . '.php'; 34 | 35 | // if the file exists, require it 36 | if (file_exists($file)) { 37 | require $file; 38 | } 39 | } 40 | }); 41 | -------------------------------------------------------------------------------- /plugin.info.txt: -------------------------------------------------------------------------------- 1 | base smtp 2 | author Andreas Gohr 3 | email andi@splitbrain.org 4 | date 2023-04-03 5 | name smtp plugin 6 | desc Send mails via a configured SMTP server 7 | url https://www.dokuwiki.org/plugin:smtp 8 | -------------------------------------------------------------------------------- /subtree/php-fig/log/.gitignore: -------------------------------------------------------------------------------- 1 | vendor 2 | -------------------------------------------------------------------------------- /subtree/php-fig/log/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012 PHP Framework Interoperability Group 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /subtree/php-fig/log/Psr/Log/AbstractLogger.php: -------------------------------------------------------------------------------- 1 | log(LogLevel::EMERGENCY, $message, $context); 25 | } 26 | 27 | /** 28 | * Action must be taken immediately. 29 | * 30 | * Example: Entire website down, database unavailable, etc. This should 31 | * trigger the SMS alerts and wake you up. 32 | * 33 | * @param string $message 34 | * @param array $context 35 | * 36 | * @return null 37 | */ 38 | public function alert($message, array $context = array()) 39 | { 40 | $this->log(LogLevel::ALERT, $message, $context); 41 | } 42 | 43 | /** 44 | * Critical conditions. 45 | * 46 | * Example: Application component unavailable, unexpected exception. 47 | * 48 | * @param string $message 49 | * @param array $context 50 | * 51 | * @return null 52 | */ 53 | public function critical($message, array $context = array()) 54 | { 55 | $this->log(LogLevel::CRITICAL, $message, $context); 56 | } 57 | 58 | /** 59 | * Runtime errors that do not require immediate action but should typically 60 | * be logged and monitored. 61 | * 62 | * @param string $message 63 | * @param array $context 64 | * 65 | * @return null 66 | */ 67 | public function error($message, array $context = array()) 68 | { 69 | $this->log(LogLevel::ERROR, $message, $context); 70 | } 71 | 72 | /** 73 | * Exceptional occurrences that are not errors. 74 | * 75 | * Example: Use of deprecated APIs, poor use of an API, undesirable things 76 | * that are not necessarily wrong. 77 | * 78 | * @param string $message 79 | * @param array $context 80 | * 81 | * @return null 82 | */ 83 | public function warning($message, array $context = array()) 84 | { 85 | $this->log(LogLevel::WARNING, $message, $context); 86 | } 87 | 88 | /** 89 | * Normal but significant events. 90 | * 91 | * @param string $message 92 | * @param array $context 93 | * 94 | * @return null 95 | */ 96 | public function notice($message, array $context = array()) 97 | { 98 | $this->log(LogLevel::NOTICE, $message, $context); 99 | } 100 | 101 | /** 102 | * Interesting events. 103 | * 104 | * Example: User logs in, SQL logs. 105 | * 106 | * @param string $message 107 | * @param array $context 108 | * 109 | * @return null 110 | */ 111 | public function info($message, array $context = array()) 112 | { 113 | $this->log(LogLevel::INFO, $message, $context); 114 | } 115 | 116 | /** 117 | * Detailed debug information. 118 | * 119 | * @param string $message 120 | * @param array $context 121 | * 122 | * @return null 123 | */ 124 | public function debug($message, array $context = array()) 125 | { 126 | $this->log(LogLevel::DEBUG, $message, $context); 127 | } 128 | } 129 | -------------------------------------------------------------------------------- /subtree/php-fig/log/Psr/Log/InvalidArgumentException.php: -------------------------------------------------------------------------------- 1 | logger = $logger; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /subtree/php-fig/log/Psr/Log/LoggerInterface.php: -------------------------------------------------------------------------------- 1 | log(LogLevel::EMERGENCY, $message, $context); 26 | } 27 | 28 | /** 29 | * Action must be taken immediately. 30 | * 31 | * Example: Entire website down, database unavailable, etc. This should 32 | * trigger the SMS alerts and wake you up. 33 | * 34 | * @param string $message 35 | * @param array $context 36 | * 37 | * @return null 38 | */ 39 | public function alert($message, array $context = array()) 40 | { 41 | $this->log(LogLevel::ALERT, $message, $context); 42 | } 43 | 44 | /** 45 | * Critical conditions. 46 | * 47 | * Example: Application component unavailable, unexpected exception. 48 | * 49 | * @param string $message 50 | * @param array $context 51 | * 52 | * @return null 53 | */ 54 | public function critical($message, array $context = array()) 55 | { 56 | $this->log(LogLevel::CRITICAL, $message, $context); 57 | } 58 | 59 | /** 60 | * Runtime errors that do not require immediate action but should typically 61 | * be logged and monitored. 62 | * 63 | * @param string $message 64 | * @param array $context 65 | * 66 | * @return null 67 | */ 68 | public function error($message, array $context = array()) 69 | { 70 | $this->log(LogLevel::ERROR, $message, $context); 71 | } 72 | 73 | /** 74 | * Exceptional occurrences that are not errors. 75 | * 76 | * Example: Use of deprecated APIs, poor use of an API, undesirable things 77 | * that are not necessarily wrong. 78 | * 79 | * @param string $message 80 | * @param array $context 81 | * 82 | * @return null 83 | */ 84 | public function warning($message, array $context = array()) 85 | { 86 | $this->log(LogLevel::WARNING, $message, $context); 87 | } 88 | 89 | /** 90 | * Normal but significant events. 91 | * 92 | * @param string $message 93 | * @param array $context 94 | * 95 | * @return null 96 | */ 97 | public function notice($message, array $context = array()) 98 | { 99 | $this->log(LogLevel::NOTICE, $message, $context); 100 | } 101 | 102 | /** 103 | * Interesting events. 104 | * 105 | * Example: User logs in, SQL logs. 106 | * 107 | * @param string $message 108 | * @param array $context 109 | * 110 | * @return null 111 | */ 112 | public function info($message, array $context = array()) 113 | { 114 | $this->log(LogLevel::INFO, $message, $context); 115 | } 116 | 117 | /** 118 | * Detailed debug information. 119 | * 120 | * @param string $message 121 | * @param array $context 122 | * 123 | * @return null 124 | */ 125 | public function debug($message, array $context = array()) 126 | { 127 | $this->log(LogLevel::DEBUG, $message, $context); 128 | } 129 | 130 | /** 131 | * Logs with an arbitrary level. 132 | * 133 | * @param mixed $level 134 | * @param string $message 135 | * @param array $context 136 | * 137 | * @return null 138 | */ 139 | abstract public function log($level, $message, array $context = array()); 140 | } 141 | -------------------------------------------------------------------------------- /subtree/php-fig/log/Psr/Log/NullLogger.php: -------------------------------------------------------------------------------- 1 | logger) { }` 11 | * blocks. 12 | */ 13 | class NullLogger extends AbstractLogger 14 | { 15 | /** 16 | * Logs with an arbitrary level. 17 | * 18 | * @param mixed $level 19 | * @param string $message 20 | * @param array $context 21 | * 22 | * @return null 23 | */ 24 | public function log($level, $message, array $context = array()) 25 | { 26 | // noop 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /subtree/php-fig/log/Psr/Log/Test/LoggerInterfaceTest.php: -------------------------------------------------------------------------------- 1 | ". 25 | * 26 | * Example ->error('Foo') would yield "error Foo". 27 | * 28 | * @return string[] 29 | */ 30 | abstract public function getLogs(); 31 | 32 | public function testImplements() 33 | { 34 | $this->assertInstanceOf('Psr\Log\LoggerInterface', $this->getLogger()); 35 | } 36 | 37 | /** 38 | * @dataProvider provideLevelsAndMessages 39 | */ 40 | public function testLogsAtAllLevels($level, $message) 41 | { 42 | $logger = $this->getLogger(); 43 | $logger->{$level}($message, array('user' => 'Bob')); 44 | $logger->log($level, $message, array('user' => 'Bob')); 45 | 46 | $expected = array( 47 | $level.' message of level '.$level.' with context: Bob', 48 | $level.' message of level '.$level.' with context: Bob', 49 | ); 50 | $this->assertEquals($expected, $this->getLogs()); 51 | } 52 | 53 | public function provideLevelsAndMessages() 54 | { 55 | return array( 56 | LogLevel::EMERGENCY => array(LogLevel::EMERGENCY, 'message of level emergency with context: {user}'), 57 | LogLevel::ALERT => array(LogLevel::ALERT, 'message of level alert with context: {user}'), 58 | LogLevel::CRITICAL => array(LogLevel::CRITICAL, 'message of level critical with context: {user}'), 59 | LogLevel::ERROR => array(LogLevel::ERROR, 'message of level error with context: {user}'), 60 | LogLevel::WARNING => array(LogLevel::WARNING, 'message of level warning with context: {user}'), 61 | LogLevel::NOTICE => array(LogLevel::NOTICE, 'message of level notice with context: {user}'), 62 | LogLevel::INFO => array(LogLevel::INFO, 'message of level info with context: {user}'), 63 | LogLevel::DEBUG => array(LogLevel::DEBUG, 'message of level debug with context: {user}'), 64 | ); 65 | } 66 | 67 | /** 68 | * @expectedException \Psr\Log\InvalidArgumentException 69 | */ 70 | public function testThrowsOnInvalidLevel() 71 | { 72 | $logger = $this->getLogger(); 73 | $logger->log('invalid level', 'Foo'); 74 | } 75 | 76 | public function testContextReplacement() 77 | { 78 | $logger = $this->getLogger(); 79 | $logger->info('{Message {nothing} {user} {foo.bar} a}', array('user' => 'Bob', 'foo.bar' => 'Bar')); 80 | 81 | $expected = array('info {Message {nothing} Bob Bar a}'); 82 | $this->assertEquals($expected, $this->getLogs()); 83 | } 84 | 85 | public function testObjectCastToString() 86 | { 87 | $dummy = $this->getMock('Psr\Log\Test\DummyTest', array('__toString')); 88 | $dummy->expects($this->once()) 89 | ->method('__toString') 90 | ->will($this->returnValue('DUMMY')); 91 | 92 | $this->getLogger()->warning($dummy); 93 | 94 | $expected = array('warning DUMMY'); 95 | $this->assertEquals($expected, $this->getLogs()); 96 | } 97 | 98 | public function testContextCanContainAnything() 99 | { 100 | $context = array( 101 | 'bool' => true, 102 | 'null' => null, 103 | 'string' => 'Foo', 104 | 'int' => 0, 105 | 'float' => 0.5, 106 | 'nested' => array('with object' => new DummyTest), 107 | 'object' => new \DateTime, 108 | 'resource' => fopen('php://memory', 'r'), 109 | ); 110 | 111 | $this->getLogger()->warning('Crazy context data', $context); 112 | 113 | $expected = array('warning Crazy context data'); 114 | $this->assertEquals($expected, $this->getLogs()); 115 | } 116 | 117 | public function testContextExceptionKeyCanBeExceptionOrOtherValues() 118 | { 119 | $logger = $this->getLogger(); 120 | $logger->warning('Random message', array('exception' => 'oops')); 121 | $logger->critical('Uncaught Exception!', array('exception' => new \LogicException('Fail'))); 122 | 123 | $expected = array( 124 | 'warning Random message', 125 | 'critical Uncaught Exception!' 126 | ); 127 | $this->assertEquals($expected, $this->getLogs()); 128 | } 129 | } 130 | 131 | class DummyTest 132 | { 133 | } 134 | -------------------------------------------------------------------------------- /subtree/php-fig/log/README.md: -------------------------------------------------------------------------------- 1 | PSR Log 2 | ======= 3 | 4 | This repository holds all interfaces/classes/traits related to 5 | [PSR-3](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md). 6 | 7 | Note that this is not a logger of its own. It is merely an interface that 8 | describes a logger. See the specification for more details. 9 | 10 | Usage 11 | ----- 12 | 13 | If you need a logger, you can use the interface like this: 14 | 15 | ```php 16 | logger = $logger; 27 | } 28 | 29 | public function doSomething() 30 | { 31 | if ($this->logger) { 32 | $this->logger->info('Doing work'); 33 | } 34 | 35 | // do something useful 36 | } 37 | } 38 | ``` 39 | 40 | You can then pick one of the implementations of the interface to get a logger. 41 | 42 | If you want to implement the interface, you can require this package and 43 | implement `Psr\Log\LoggerInterface` in your code. Please read the 44 | [specification text](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md) 45 | for details. 46 | -------------------------------------------------------------------------------- /subtree/php-fig/log/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "psr/log", 3 | "description": "Common interface for logging libraries", 4 | "keywords": ["psr", "psr-3", "log"], 5 | "license": "MIT", 6 | "authors": [ 7 | { 8 | "name": "PHP-FIG", 9 | "homepage": "http://www.php-fig.org/" 10 | } 11 | ], 12 | "require": { 13 | "php": ">=5.3.0" 14 | }, 15 | "autoload": { 16 | "psr-4": { 17 | "Psr\\Log\\": "Psr/Log/" 18 | } 19 | }, 20 | "extra": { 21 | "branch-alias": { 22 | "dev-master": "1.0.x-dev" 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /subtree/txtthinking/Mailer/.gitignore: -------------------------------------------------------------------------------- 1 | vendor/ 2 | composer.lock 3 | .idea/ 4 | docs/ 5 | -------------------------------------------------------------------------------- /subtree/txtthinking/Mailer/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2013 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /subtree/txtthinking/Mailer/README.md: -------------------------------------------------------------------------------- 1 | Mailer 2 | ======= 3 | 4 | A lightweight SMTP mail sender 5 | 6 | ### Install 7 | 8 | ``` 9 | $ composer require txthinking/mailer 10 | ``` 11 | 12 | ### Usage 13 | 14 | ``` 15 | setServer('smtp.ym.163.com', 25) 20 | ->setAuth('', '') // email, password 21 | ->setFrom('You', '') //your name, your email 22 | ->setFakeFrom('heelo', 'bot@fake.com') // if u want, a fake name, a fake email 23 | ->addTo('Cloud', 'cloud@txthinking.com') 24 | ->setSubject('Test Mailer') 25 | ->setBody('Hi, I love you.') 26 | ->addAttachment('host', '/etc/hosts') 27 | ->send(); 28 | var_dump($ok); 29 | ``` 30 | OR 31 | ``` 32 | setServer('smtp.ym.163.com', 25) 39 | ->setAuth('bot@ym.txthinking.com', ''); // email, password 40 | 41 | $message = new Message(); 42 | $message->setFrom('Tom', 'your@mail.com') // your name, your email 43 | ->setFakeFrom('heelo', 'bot@fake.com') // if u want, a fake name, a fake email 44 | ->addTo('Cloud', 'cloud@txthinking.com') 45 | ->setSubject('Test Mailer') 46 | ->setBody('

For test

') 47 | ->addAttachment('host', '/etc/hosts'); 48 | 49 | $ok = $smtp->send($message); 50 | var_dump($ok); 51 | ``` 52 | -------------------------------------------------------------------------------- /subtree/txtthinking/Mailer/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "txthinking/mailer", 3 | "type": "library", 4 | "keywords": ["mail", "smtp"], 5 | "description": "A very lightweight PHP SMTP mail sender", 6 | "license": "MIT", 7 | "homepage": "http://github.com/txthinking/Mailer", 8 | "authors": [ 9 | { 10 | "name": "Cloud", 11 | "email": "cloud@txthinking.com", 12 | "homepage": "http://www.txthinking.com", 13 | "role": "Thinker" 14 | }, 15 | { 16 | "name": "Matt Sowers", 17 | "email": "msowers@erblearn.org" 18 | } 19 | ], 20 | "require": { 21 | "php": ">=5.3.2", 22 | "psr/log": "~1.0" 23 | }, 24 | "require-dev": { 25 | "phpunit/phpunit": "~4.0", 26 | "erb/testing-tools": "dev-master", 27 | "monolog/monolog": "~1.13" 28 | }, 29 | "autoload": { 30 | "psr-4": { 31 | "Tx\\": "src/" 32 | } 33 | }, 34 | "autoload-dev": { 35 | "classmap": [ 36 | "tests/TestCase.php" 37 | ] 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /subtree/txtthinking/Mailer/composer.lock: -------------------------------------------------------------------------------- 1 | { 2 | "_readme": [ 3 | "This file locks the dependencies of your project to a known state", 4 | "Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", 5 | "This file is @generated automatically" 6 | ], 7 | "hash": "0d4b12d16d8fbbdb98ed9f74ecdf6d4e", 8 | "packages": [ 9 | { 10 | "name": "psr/log", 11 | "version": "1.0.0", 12 | "source": { 13 | "type": "git", 14 | "url": "https://github.com/php-fig/log.git", 15 | "reference": "fe0936ee26643249e916849d48e3a51d5f5e278b" 16 | }, 17 | "dist": { 18 | "type": "zip", 19 | "url": "https://api.github.com/repos/php-fig/log/zipball/fe0936ee26643249e916849d48e3a51d5f5e278b", 20 | "reference": "fe0936ee26643249e916849d48e3a51d5f5e278b", 21 | "shasum": "" 22 | }, 23 | "type": "library", 24 | "autoload": { 25 | "psr-0": { 26 | "Psr\\Log\\": "" 27 | } 28 | }, 29 | "notification-url": "https://packagist.org/downloads/", 30 | "license": [ 31 | "MIT" 32 | ], 33 | "authors": [ 34 | { 35 | "name": "PHP-FIG", 36 | "homepage": "http://www.php-fig.org/" 37 | } 38 | ], 39 | "description": "Common interface for logging libraries", 40 | "keywords": [ 41 | "log", 42 | "psr", 43 | "psr-3" 44 | ], 45 | "time": "2012-12-21 11:40:51" 46 | } 47 | ], 48 | "packages-dev": [ 49 | { 50 | "name": "doctrine/instantiator", 51 | "version": "1.0.5", 52 | "source": { 53 | "type": "git", 54 | "url": "https://github.com/doctrine/instantiator.git", 55 | "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d" 56 | }, 57 | "dist": { 58 | "type": "zip", 59 | "url": "https://api.github.com/repos/doctrine/instantiator/zipball/8e884e78f9f0eb1329e445619e04456e64d8051d", 60 | "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d", 61 | "shasum": "" 62 | }, 63 | "require": { 64 | "php": ">=5.3,<8.0-DEV" 65 | }, 66 | "require-dev": { 67 | "athletic/athletic": "~0.1.8", 68 | "ext-pdo": "*", 69 | "ext-phar": "*", 70 | "phpunit/phpunit": "~4.0", 71 | "squizlabs/php_codesniffer": "~2.0" 72 | }, 73 | "type": "library", 74 | "extra": { 75 | "branch-alias": { 76 | "dev-master": "1.0.x-dev" 77 | } 78 | }, 79 | "autoload": { 80 | "psr-4": { 81 | "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" 82 | } 83 | }, 84 | "notification-url": "https://packagist.org/downloads/", 85 | "license": [ 86 | "MIT" 87 | ], 88 | "authors": [ 89 | { 90 | "name": "Marco Pivetta", 91 | "email": "ocramius@gmail.com", 92 | "homepage": "http://ocramius.github.com/" 93 | } 94 | ], 95 | "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", 96 | "homepage": "https://github.com/doctrine/instantiator", 97 | "keywords": [ 98 | "constructor", 99 | "instantiate" 100 | ], 101 | "time": "2015-06-14 21:17:01" 102 | }, 103 | { 104 | "name": "erb/testing-tools", 105 | "version": "dev-master", 106 | "source": { 107 | "type": "git", 108 | "url": "https://bitbucket.org/erblearn/testing-tools.git", 109 | "reference": "a898dc79b91c73a6fee7005e4189451d7a4235cc" 110 | }, 111 | "dist": { 112 | "type": "zip", 113 | "url": "https://bitbucket.org/erblearn/testing-tools/get/a898dc79b91c73a6fee7005e4189451d7a4235cc.zip", 114 | "reference": "a898dc79b91c73a6fee7005e4189451d7a4235cc", 115 | "shasum": "" 116 | }, 117 | "type": "library", 118 | "autoload": { 119 | "psr-4": { 120 | "ERB\\": "src/" 121 | } 122 | }, 123 | "notification-url": "https://packagist.org/downloads/", 124 | "license": [ 125 | "MIT" 126 | ], 127 | "authors": [ 128 | { 129 | "name": "Matt Sowers", 130 | "email": "msowers@erblearn.org" 131 | } 132 | ], 133 | "description": "Tools to make it easier to retrieve data from classes via Reflection.", 134 | "homepage": "https://bitbucket.org/erblearn/testing-tools", 135 | "keywords": [ 136 | "reflection", 137 | "testing", 138 | "useful tools" 139 | ], 140 | "time": "2015-04-06 16:00:22" 141 | }, 142 | { 143 | "name": "monolog/monolog", 144 | "version": "1.15.0", 145 | "source": { 146 | "type": "git", 147 | "url": "https://github.com/Seldaek/monolog.git", 148 | "reference": "dc5150cc608f2334c72c3b6a553ec9668a4156b0" 149 | }, 150 | "dist": { 151 | "type": "zip", 152 | "url": "https://api.github.com/repos/Seldaek/monolog/zipball/dc5150cc608f2334c72c3b6a553ec9668a4156b0", 153 | "reference": "dc5150cc608f2334c72c3b6a553ec9668a4156b0", 154 | "shasum": "" 155 | }, 156 | "require": { 157 | "php": ">=5.3.0", 158 | "psr/log": "~1.0" 159 | }, 160 | "provide": { 161 | "psr/log-implementation": "1.0.0" 162 | }, 163 | "require-dev": { 164 | "aws/aws-sdk-php": "^2.4.9", 165 | "doctrine/couchdb": "~1.0@dev", 166 | "graylog2/gelf-php": "~1.0", 167 | "php-console/php-console": "^3.1.3", 168 | "phpunit/phpunit": "~4.5", 169 | "phpunit/phpunit-mock-objects": "2.3.0", 170 | "raven/raven": "~0.8", 171 | "ruflin/elastica": ">=0.90 <3.0", 172 | "swiftmailer/swiftmailer": "~5.3", 173 | "videlalvaro/php-amqplib": "~2.4" 174 | }, 175 | "suggest": { 176 | "aws/aws-sdk-php": "Allow sending log messages to AWS services like DynamoDB", 177 | "doctrine/couchdb": "Allow sending log messages to a CouchDB server", 178 | "ext-amqp": "Allow sending log messages to an AMQP server (1.0+ required)", 179 | "ext-mongo": "Allow sending log messages to a MongoDB server", 180 | "graylog2/gelf-php": "Allow sending log messages to a GrayLog2 server", 181 | "php-console/php-console": "Allow sending log messages to Google Chrome", 182 | "raven/raven": "Allow sending log messages to a Sentry server", 183 | "rollbar/rollbar": "Allow sending log messages to Rollbar", 184 | "ruflin/elastica": "Allow sending log messages to an Elastic Search server", 185 | "videlalvaro/php-amqplib": "Allow sending log messages to an AMQP server using php-amqplib" 186 | }, 187 | "type": "library", 188 | "extra": { 189 | "branch-alias": { 190 | "dev-master": "1.15.x-dev" 191 | } 192 | }, 193 | "autoload": { 194 | "psr-4": { 195 | "Monolog\\": "src/Monolog" 196 | } 197 | }, 198 | "notification-url": "https://packagist.org/downloads/", 199 | "license": [ 200 | "MIT" 201 | ], 202 | "authors": [ 203 | { 204 | "name": "Jordi Boggiano", 205 | "email": "j.boggiano@seld.be", 206 | "homepage": "http://seld.be" 207 | } 208 | ], 209 | "description": "Sends your logs to files, sockets, inboxes, databases and various web services", 210 | "homepage": "http://github.com/Seldaek/monolog", 211 | "keywords": [ 212 | "log", 213 | "logging", 214 | "psr-3" 215 | ], 216 | "time": "2015-07-12 13:54:09" 217 | }, 218 | { 219 | "name": "phpdocumentor/reflection-docblock", 220 | "version": "2.0.4", 221 | "source": { 222 | "type": "git", 223 | "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", 224 | "reference": "d68dbdc53dc358a816f00b300704702b2eaff7b8" 225 | }, 226 | "dist": { 227 | "type": "zip", 228 | "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/d68dbdc53dc358a816f00b300704702b2eaff7b8", 229 | "reference": "d68dbdc53dc358a816f00b300704702b2eaff7b8", 230 | "shasum": "" 231 | }, 232 | "require": { 233 | "php": ">=5.3.3" 234 | }, 235 | "require-dev": { 236 | "phpunit/phpunit": "~4.0" 237 | }, 238 | "suggest": { 239 | "dflydev/markdown": "~1.0", 240 | "erusev/parsedown": "~1.0" 241 | }, 242 | "type": "library", 243 | "extra": { 244 | "branch-alias": { 245 | "dev-master": "2.0.x-dev" 246 | } 247 | }, 248 | "autoload": { 249 | "psr-0": { 250 | "phpDocumentor": [ 251 | "src/" 252 | ] 253 | } 254 | }, 255 | "notification-url": "https://packagist.org/downloads/", 256 | "license": [ 257 | "MIT" 258 | ], 259 | "authors": [ 260 | { 261 | "name": "Mike van Riel", 262 | "email": "mike.vanriel@naenius.com" 263 | } 264 | ], 265 | "time": "2015-02-03 12:10:50" 266 | }, 267 | { 268 | "name": "phpspec/prophecy", 269 | "version": "v1.4.1", 270 | "source": { 271 | "type": "git", 272 | "url": "https://github.com/phpspec/prophecy.git", 273 | "reference": "3132b1f44c7bf2ec4c7eb2d3cb78fdeca760d373" 274 | }, 275 | "dist": { 276 | "type": "zip", 277 | "url": "https://api.github.com/repos/phpspec/prophecy/zipball/3132b1f44c7bf2ec4c7eb2d3cb78fdeca760d373", 278 | "reference": "3132b1f44c7bf2ec4c7eb2d3cb78fdeca760d373", 279 | "shasum": "" 280 | }, 281 | "require": { 282 | "doctrine/instantiator": "^1.0.2", 283 | "phpdocumentor/reflection-docblock": "~2.0", 284 | "sebastian/comparator": "~1.1" 285 | }, 286 | "require-dev": { 287 | "phpspec/phpspec": "~2.0" 288 | }, 289 | "type": "library", 290 | "extra": { 291 | "branch-alias": { 292 | "dev-master": "1.4.x-dev" 293 | } 294 | }, 295 | "autoload": { 296 | "psr-0": { 297 | "Prophecy\\": "src/" 298 | } 299 | }, 300 | "notification-url": "https://packagist.org/downloads/", 301 | "license": [ 302 | "MIT" 303 | ], 304 | "authors": [ 305 | { 306 | "name": "Konstantin Kudryashov", 307 | "email": "ever.zet@gmail.com", 308 | "homepage": "http://everzet.com" 309 | }, 310 | { 311 | "name": "Marcello Duarte", 312 | "email": "marcello.duarte@gmail.com" 313 | } 314 | ], 315 | "description": "Highly opinionated mocking framework for PHP 5.3+", 316 | "homepage": "https://github.com/phpspec/prophecy", 317 | "keywords": [ 318 | "Double", 319 | "Dummy", 320 | "fake", 321 | "mock", 322 | "spy", 323 | "stub" 324 | ], 325 | "time": "2015-04-27 22:15:08" 326 | }, 327 | { 328 | "name": "phpunit/php-code-coverage", 329 | "version": "2.1.9", 330 | "source": { 331 | "type": "git", 332 | "url": "https://github.com/sebastianbergmann/php-code-coverage.git", 333 | "reference": "5bd48b86cd282da411bb80baac1398ce3fefac41" 334 | }, 335 | "dist": { 336 | "type": "zip", 337 | "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/5bd48b86cd282da411bb80baac1398ce3fefac41", 338 | "reference": "5bd48b86cd282da411bb80baac1398ce3fefac41", 339 | "shasum": "" 340 | }, 341 | "require": { 342 | "php": ">=5.3.3", 343 | "phpunit/php-file-iterator": "~1.3", 344 | "phpunit/php-text-template": "~1.2", 345 | "phpunit/php-token-stream": "~1.3", 346 | "sebastian/environment": "~1.0", 347 | "sebastian/version": "~1.0" 348 | }, 349 | "require-dev": { 350 | "ext-xdebug": ">=2.1.4", 351 | "phpunit/phpunit": "~4" 352 | }, 353 | "suggest": { 354 | "ext-dom": "*", 355 | "ext-xdebug": ">=2.2.1", 356 | "ext-xmlwriter": "*" 357 | }, 358 | "type": "library", 359 | "extra": { 360 | "branch-alias": { 361 | "dev-master": "2.1.x-dev" 362 | } 363 | }, 364 | "autoload": { 365 | "classmap": [ 366 | "src/" 367 | ] 368 | }, 369 | "notification-url": "https://packagist.org/downloads/", 370 | "license": [ 371 | "BSD-3-Clause" 372 | ], 373 | "authors": [ 374 | { 375 | "name": "Sebastian Bergmann", 376 | "email": "sb@sebastian-bergmann.de", 377 | "role": "lead" 378 | } 379 | ], 380 | "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", 381 | "homepage": "https://github.com/sebastianbergmann/php-code-coverage", 382 | "keywords": [ 383 | "coverage", 384 | "testing", 385 | "xunit" 386 | ], 387 | "time": "2015-07-26 12:54:47" 388 | }, 389 | { 390 | "name": "phpunit/php-file-iterator", 391 | "version": "1.4.1", 392 | "source": { 393 | "type": "git", 394 | "url": "https://github.com/sebastianbergmann/php-file-iterator.git", 395 | "reference": "6150bf2c35d3fc379e50c7602b75caceaa39dbf0" 396 | }, 397 | "dist": { 398 | "type": "zip", 399 | "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/6150bf2c35d3fc379e50c7602b75caceaa39dbf0", 400 | "reference": "6150bf2c35d3fc379e50c7602b75caceaa39dbf0", 401 | "shasum": "" 402 | }, 403 | "require": { 404 | "php": ">=5.3.3" 405 | }, 406 | "type": "library", 407 | "extra": { 408 | "branch-alias": { 409 | "dev-master": "1.4.x-dev" 410 | } 411 | }, 412 | "autoload": { 413 | "classmap": [ 414 | "src/" 415 | ] 416 | }, 417 | "notification-url": "https://packagist.org/downloads/", 418 | "license": [ 419 | "BSD-3-Clause" 420 | ], 421 | "authors": [ 422 | { 423 | "name": "Sebastian Bergmann", 424 | "email": "sb@sebastian-bergmann.de", 425 | "role": "lead" 426 | } 427 | ], 428 | "description": "FilterIterator implementation that filters files based on a list of suffixes.", 429 | "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", 430 | "keywords": [ 431 | "filesystem", 432 | "iterator" 433 | ], 434 | "time": "2015-06-21 13:08:43" 435 | }, 436 | { 437 | "name": "phpunit/php-text-template", 438 | "version": "1.2.1", 439 | "source": { 440 | "type": "git", 441 | "url": "https://github.com/sebastianbergmann/php-text-template.git", 442 | "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686" 443 | }, 444 | "dist": { 445 | "type": "zip", 446 | "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686", 447 | "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686", 448 | "shasum": "" 449 | }, 450 | "require": { 451 | "php": ">=5.3.3" 452 | }, 453 | "type": "library", 454 | "autoload": { 455 | "classmap": [ 456 | "src/" 457 | ] 458 | }, 459 | "notification-url": "https://packagist.org/downloads/", 460 | "license": [ 461 | "BSD-3-Clause" 462 | ], 463 | "authors": [ 464 | { 465 | "name": "Sebastian Bergmann", 466 | "email": "sebastian@phpunit.de", 467 | "role": "lead" 468 | } 469 | ], 470 | "description": "Simple template engine.", 471 | "homepage": "https://github.com/sebastianbergmann/php-text-template/", 472 | "keywords": [ 473 | "template" 474 | ], 475 | "time": "2015-06-21 13:50:34" 476 | }, 477 | { 478 | "name": "phpunit/php-timer", 479 | "version": "1.0.7", 480 | "source": { 481 | "type": "git", 482 | "url": "https://github.com/sebastianbergmann/php-timer.git", 483 | "reference": "3e82f4e9fc92665fafd9157568e4dcb01d014e5b" 484 | }, 485 | "dist": { 486 | "type": "zip", 487 | "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3e82f4e9fc92665fafd9157568e4dcb01d014e5b", 488 | "reference": "3e82f4e9fc92665fafd9157568e4dcb01d014e5b", 489 | "shasum": "" 490 | }, 491 | "require": { 492 | "php": ">=5.3.3" 493 | }, 494 | "type": "library", 495 | "autoload": { 496 | "classmap": [ 497 | "src/" 498 | ] 499 | }, 500 | "notification-url": "https://packagist.org/downloads/", 501 | "license": [ 502 | "BSD-3-Clause" 503 | ], 504 | "authors": [ 505 | { 506 | "name": "Sebastian Bergmann", 507 | "email": "sb@sebastian-bergmann.de", 508 | "role": "lead" 509 | } 510 | ], 511 | "description": "Utility class for timing", 512 | "homepage": "https://github.com/sebastianbergmann/php-timer/", 513 | "keywords": [ 514 | "timer" 515 | ], 516 | "time": "2015-06-21 08:01:12" 517 | }, 518 | { 519 | "name": "phpunit/php-token-stream", 520 | "version": "1.4.3", 521 | "source": { 522 | "type": "git", 523 | "url": "https://github.com/sebastianbergmann/php-token-stream.git", 524 | "reference": "7a9b0969488c3c54fd62b4d504b3ec758fd005d9" 525 | }, 526 | "dist": { 527 | "type": "zip", 528 | "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/7a9b0969488c3c54fd62b4d504b3ec758fd005d9", 529 | "reference": "7a9b0969488c3c54fd62b4d504b3ec758fd005d9", 530 | "shasum": "" 531 | }, 532 | "require": { 533 | "ext-tokenizer": "*", 534 | "php": ">=5.3.3" 535 | }, 536 | "require-dev": { 537 | "phpunit/phpunit": "~4.2" 538 | }, 539 | "type": "library", 540 | "extra": { 541 | "branch-alias": { 542 | "dev-master": "1.4-dev" 543 | } 544 | }, 545 | "autoload": { 546 | "classmap": [ 547 | "src/" 548 | ] 549 | }, 550 | "notification-url": "https://packagist.org/downloads/", 551 | "license": [ 552 | "BSD-3-Clause" 553 | ], 554 | "authors": [ 555 | { 556 | "name": "Sebastian Bergmann", 557 | "email": "sebastian@phpunit.de" 558 | } 559 | ], 560 | "description": "Wrapper around PHP's tokenizer extension.", 561 | "homepage": "https://github.com/sebastianbergmann/php-token-stream/", 562 | "keywords": [ 563 | "tokenizer" 564 | ], 565 | "time": "2015-06-19 03:43:16" 566 | }, 567 | { 568 | "name": "phpunit/phpunit", 569 | "version": "4.7.7", 570 | "source": { 571 | "type": "git", 572 | "url": "https://github.com/sebastianbergmann/phpunit.git", 573 | "reference": "9b97f9d807b862c2de2a36e86690000801c85724" 574 | }, 575 | "dist": { 576 | "type": "zip", 577 | "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/9b97f9d807b862c2de2a36e86690000801c85724", 578 | "reference": "9b97f9d807b862c2de2a36e86690000801c85724", 579 | "shasum": "" 580 | }, 581 | "require": { 582 | "ext-dom": "*", 583 | "ext-json": "*", 584 | "ext-pcre": "*", 585 | "ext-reflection": "*", 586 | "ext-spl": "*", 587 | "php": ">=5.3.3", 588 | "phpspec/prophecy": "~1.3,>=1.3.1", 589 | "phpunit/php-code-coverage": "~2.1", 590 | "phpunit/php-file-iterator": "~1.4", 591 | "phpunit/php-text-template": "~1.2", 592 | "phpunit/php-timer": ">=1.0.6", 593 | "phpunit/phpunit-mock-objects": "~2.3", 594 | "sebastian/comparator": "~1.1", 595 | "sebastian/diff": "~1.2", 596 | "sebastian/environment": "~1.2", 597 | "sebastian/exporter": "~1.2", 598 | "sebastian/global-state": "~1.0", 599 | "sebastian/version": "~1.0", 600 | "symfony/yaml": "~2.1|~3.0" 601 | }, 602 | "suggest": { 603 | "phpunit/php-invoker": "~1.1" 604 | }, 605 | "bin": [ 606 | "phpunit" 607 | ], 608 | "type": "library", 609 | "extra": { 610 | "branch-alias": { 611 | "dev-master": "4.7.x-dev" 612 | } 613 | }, 614 | "autoload": { 615 | "classmap": [ 616 | "src/" 617 | ] 618 | }, 619 | "notification-url": "https://packagist.org/downloads/", 620 | "license": [ 621 | "BSD-3-Clause" 622 | ], 623 | "authors": [ 624 | { 625 | "name": "Sebastian Bergmann", 626 | "email": "sebastian@phpunit.de", 627 | "role": "lead" 628 | } 629 | ], 630 | "description": "The PHP Unit Testing framework.", 631 | "homepage": "https://phpunit.de/", 632 | "keywords": [ 633 | "phpunit", 634 | "testing", 635 | "xunit" 636 | ], 637 | "time": "2015-07-13 11:28:34" 638 | }, 639 | { 640 | "name": "phpunit/phpunit-mock-objects", 641 | "version": "2.3.6", 642 | "source": { 643 | "type": "git", 644 | "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", 645 | "reference": "18dfbcb81d05e2296c0bcddd4db96cade75e6f42" 646 | }, 647 | "dist": { 648 | "type": "zip", 649 | "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/18dfbcb81d05e2296c0bcddd4db96cade75e6f42", 650 | "reference": "18dfbcb81d05e2296c0bcddd4db96cade75e6f42", 651 | "shasum": "" 652 | }, 653 | "require": { 654 | "doctrine/instantiator": "~1.0,>=1.0.2", 655 | "php": ">=5.3.3", 656 | "phpunit/php-text-template": "~1.2", 657 | "sebastian/exporter": "~1.2" 658 | }, 659 | "require-dev": { 660 | "phpunit/phpunit": "~4.4" 661 | }, 662 | "suggest": { 663 | "ext-soap": "*" 664 | }, 665 | "type": "library", 666 | "extra": { 667 | "branch-alias": { 668 | "dev-master": "2.3.x-dev" 669 | } 670 | }, 671 | "autoload": { 672 | "classmap": [ 673 | "src/" 674 | ] 675 | }, 676 | "notification-url": "https://packagist.org/downloads/", 677 | "license": [ 678 | "BSD-3-Clause" 679 | ], 680 | "authors": [ 681 | { 682 | "name": "Sebastian Bergmann", 683 | "email": "sb@sebastian-bergmann.de", 684 | "role": "lead" 685 | } 686 | ], 687 | "description": "Mock Object library for PHPUnit", 688 | "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", 689 | "keywords": [ 690 | "mock", 691 | "xunit" 692 | ], 693 | "time": "2015-07-10 06:54:24" 694 | }, 695 | { 696 | "name": "sebastian/comparator", 697 | "version": "1.2.0", 698 | "source": { 699 | "type": "git", 700 | "url": "https://github.com/sebastianbergmann/comparator.git", 701 | "reference": "937efb279bd37a375bcadf584dec0726f84dbf22" 702 | }, 703 | "dist": { 704 | "type": "zip", 705 | "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/937efb279bd37a375bcadf584dec0726f84dbf22", 706 | "reference": "937efb279bd37a375bcadf584dec0726f84dbf22", 707 | "shasum": "" 708 | }, 709 | "require": { 710 | "php": ">=5.3.3", 711 | "sebastian/diff": "~1.2", 712 | "sebastian/exporter": "~1.2" 713 | }, 714 | "require-dev": { 715 | "phpunit/phpunit": "~4.4" 716 | }, 717 | "type": "library", 718 | "extra": { 719 | "branch-alias": { 720 | "dev-master": "1.2.x-dev" 721 | } 722 | }, 723 | "autoload": { 724 | "classmap": [ 725 | "src/" 726 | ] 727 | }, 728 | "notification-url": "https://packagist.org/downloads/", 729 | "license": [ 730 | "BSD-3-Clause" 731 | ], 732 | "authors": [ 733 | { 734 | "name": "Jeff Welch", 735 | "email": "whatthejeff@gmail.com" 736 | }, 737 | { 738 | "name": "Volker Dusch", 739 | "email": "github@wallbash.com" 740 | }, 741 | { 742 | "name": "Bernhard Schussek", 743 | "email": "bschussek@2bepublished.at" 744 | }, 745 | { 746 | "name": "Sebastian Bergmann", 747 | "email": "sebastian@phpunit.de" 748 | } 749 | ], 750 | "description": "Provides the functionality to compare PHP values for equality", 751 | "homepage": "http://www.github.com/sebastianbergmann/comparator", 752 | "keywords": [ 753 | "comparator", 754 | "compare", 755 | "equality" 756 | ], 757 | "time": "2015-07-26 15:48:44" 758 | }, 759 | { 760 | "name": "sebastian/diff", 761 | "version": "1.3.0", 762 | "source": { 763 | "type": "git", 764 | "url": "https://github.com/sebastianbergmann/diff.git", 765 | "reference": "863df9687835c62aa423a22412d26fa2ebde3fd3" 766 | }, 767 | "dist": { 768 | "type": "zip", 769 | "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/863df9687835c62aa423a22412d26fa2ebde3fd3", 770 | "reference": "863df9687835c62aa423a22412d26fa2ebde3fd3", 771 | "shasum": "" 772 | }, 773 | "require": { 774 | "php": ">=5.3.3" 775 | }, 776 | "require-dev": { 777 | "phpunit/phpunit": "~4.2" 778 | }, 779 | "type": "library", 780 | "extra": { 781 | "branch-alias": { 782 | "dev-master": "1.3-dev" 783 | } 784 | }, 785 | "autoload": { 786 | "classmap": [ 787 | "src/" 788 | ] 789 | }, 790 | "notification-url": "https://packagist.org/downloads/", 791 | "license": [ 792 | "BSD-3-Clause" 793 | ], 794 | "authors": [ 795 | { 796 | "name": "Kore Nordmann", 797 | "email": "mail@kore-nordmann.de" 798 | }, 799 | { 800 | "name": "Sebastian Bergmann", 801 | "email": "sebastian@phpunit.de" 802 | } 803 | ], 804 | "description": "Diff implementation", 805 | "homepage": "http://www.github.com/sebastianbergmann/diff", 806 | "keywords": [ 807 | "diff" 808 | ], 809 | "time": "2015-02-22 15:13:53" 810 | }, 811 | { 812 | "name": "sebastian/environment", 813 | "version": "1.3.0", 814 | "source": { 815 | "type": "git", 816 | "url": "https://github.com/sebastianbergmann/environment.git", 817 | "reference": "4fe0a44cddd8cc19583a024bdc7374eb2fef0b87" 818 | }, 819 | "dist": { 820 | "type": "zip", 821 | "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/4fe0a44cddd8cc19583a024bdc7374eb2fef0b87", 822 | "reference": "4fe0a44cddd8cc19583a024bdc7374eb2fef0b87", 823 | "shasum": "" 824 | }, 825 | "require": { 826 | "php": ">=5.3.3" 827 | }, 828 | "require-dev": { 829 | "phpunit/phpunit": "~4.4" 830 | }, 831 | "type": "library", 832 | "extra": { 833 | "branch-alias": { 834 | "dev-master": "1.3.x-dev" 835 | } 836 | }, 837 | "autoload": { 838 | "classmap": [ 839 | "src/" 840 | ] 841 | }, 842 | "notification-url": "https://packagist.org/downloads/", 843 | "license": [ 844 | "BSD-3-Clause" 845 | ], 846 | "authors": [ 847 | { 848 | "name": "Sebastian Bergmann", 849 | "email": "sebastian@phpunit.de" 850 | } 851 | ], 852 | "description": "Provides functionality to handle HHVM/PHP environments", 853 | "homepage": "http://www.github.com/sebastianbergmann/environment", 854 | "keywords": [ 855 | "Xdebug", 856 | "environment", 857 | "hhvm" 858 | ], 859 | "time": "2015-07-26 06:42:57" 860 | }, 861 | { 862 | "name": "sebastian/exporter", 863 | "version": "1.2.1", 864 | "source": { 865 | "type": "git", 866 | "url": "https://github.com/sebastianbergmann/exporter.git", 867 | "reference": "7ae5513327cb536431847bcc0c10edba2701064e" 868 | }, 869 | "dist": { 870 | "type": "zip", 871 | "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/7ae5513327cb536431847bcc0c10edba2701064e", 872 | "reference": "7ae5513327cb536431847bcc0c10edba2701064e", 873 | "shasum": "" 874 | }, 875 | "require": { 876 | "php": ">=5.3.3", 877 | "sebastian/recursion-context": "~1.0" 878 | }, 879 | "require-dev": { 880 | "phpunit/phpunit": "~4.4" 881 | }, 882 | "type": "library", 883 | "extra": { 884 | "branch-alias": { 885 | "dev-master": "1.2.x-dev" 886 | } 887 | }, 888 | "autoload": { 889 | "classmap": [ 890 | "src/" 891 | ] 892 | }, 893 | "notification-url": "https://packagist.org/downloads/", 894 | "license": [ 895 | "BSD-3-Clause" 896 | ], 897 | "authors": [ 898 | { 899 | "name": "Jeff Welch", 900 | "email": "whatthejeff@gmail.com" 901 | }, 902 | { 903 | "name": "Volker Dusch", 904 | "email": "github@wallbash.com" 905 | }, 906 | { 907 | "name": "Bernhard Schussek", 908 | "email": "bschussek@2bepublished.at" 909 | }, 910 | { 911 | "name": "Sebastian Bergmann", 912 | "email": "sebastian@phpunit.de" 913 | }, 914 | { 915 | "name": "Adam Harvey", 916 | "email": "aharvey@php.net" 917 | } 918 | ], 919 | "description": "Provides the functionality to export PHP variables for visualization", 920 | "homepage": "http://www.github.com/sebastianbergmann/exporter", 921 | "keywords": [ 922 | "export", 923 | "exporter" 924 | ], 925 | "time": "2015-06-21 07:55:53" 926 | }, 927 | { 928 | "name": "sebastian/global-state", 929 | "version": "1.0.0", 930 | "source": { 931 | "type": "git", 932 | "url": "https://github.com/sebastianbergmann/global-state.git", 933 | "reference": "c7428acdb62ece0a45e6306f1ae85e1c05b09c01" 934 | }, 935 | "dist": { 936 | "type": "zip", 937 | "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/c7428acdb62ece0a45e6306f1ae85e1c05b09c01", 938 | "reference": "c7428acdb62ece0a45e6306f1ae85e1c05b09c01", 939 | "shasum": "" 940 | }, 941 | "require": { 942 | "php": ">=5.3.3" 943 | }, 944 | "require-dev": { 945 | "phpunit/phpunit": "~4.2" 946 | }, 947 | "suggest": { 948 | "ext-uopz": "*" 949 | }, 950 | "type": "library", 951 | "extra": { 952 | "branch-alias": { 953 | "dev-master": "1.0-dev" 954 | } 955 | }, 956 | "autoload": { 957 | "classmap": [ 958 | "src/" 959 | ] 960 | }, 961 | "notification-url": "https://packagist.org/downloads/", 962 | "license": [ 963 | "BSD-3-Clause" 964 | ], 965 | "authors": [ 966 | { 967 | "name": "Sebastian Bergmann", 968 | "email": "sebastian@phpunit.de" 969 | } 970 | ], 971 | "description": "Snapshotting of global state", 972 | "homepage": "http://www.github.com/sebastianbergmann/global-state", 973 | "keywords": [ 974 | "global state" 975 | ], 976 | "time": "2014-10-06 09:23:50" 977 | }, 978 | { 979 | "name": "sebastian/recursion-context", 980 | "version": "1.0.1", 981 | "source": { 982 | "type": "git", 983 | "url": "https://github.com/sebastianbergmann/recursion-context.git", 984 | "reference": "994d4a811bafe801fb06dccbee797863ba2792ba" 985 | }, 986 | "dist": { 987 | "type": "zip", 988 | "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/994d4a811bafe801fb06dccbee797863ba2792ba", 989 | "reference": "994d4a811bafe801fb06dccbee797863ba2792ba", 990 | "shasum": "" 991 | }, 992 | "require": { 993 | "php": ">=5.3.3" 994 | }, 995 | "require-dev": { 996 | "phpunit/phpunit": "~4.4" 997 | }, 998 | "type": "library", 999 | "extra": { 1000 | "branch-alias": { 1001 | "dev-master": "1.0.x-dev" 1002 | } 1003 | }, 1004 | "autoload": { 1005 | "classmap": [ 1006 | "src/" 1007 | ] 1008 | }, 1009 | "notification-url": "https://packagist.org/downloads/", 1010 | "license": [ 1011 | "BSD-3-Clause" 1012 | ], 1013 | "authors": [ 1014 | { 1015 | "name": "Jeff Welch", 1016 | "email": "whatthejeff@gmail.com" 1017 | }, 1018 | { 1019 | "name": "Sebastian Bergmann", 1020 | "email": "sebastian@phpunit.de" 1021 | }, 1022 | { 1023 | "name": "Adam Harvey", 1024 | "email": "aharvey@php.net" 1025 | } 1026 | ], 1027 | "description": "Provides functionality to recursively process PHP variables", 1028 | "homepage": "http://www.github.com/sebastianbergmann/recursion-context", 1029 | "time": "2015-06-21 08:04:50" 1030 | }, 1031 | { 1032 | "name": "sebastian/version", 1033 | "version": "1.0.6", 1034 | "source": { 1035 | "type": "git", 1036 | "url": "https://github.com/sebastianbergmann/version.git", 1037 | "reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6" 1038 | }, 1039 | "dist": { 1040 | "type": "zip", 1041 | "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/58b3a85e7999757d6ad81c787a1fbf5ff6c628c6", 1042 | "reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6", 1043 | "shasum": "" 1044 | }, 1045 | "type": "library", 1046 | "autoload": { 1047 | "classmap": [ 1048 | "src/" 1049 | ] 1050 | }, 1051 | "notification-url": "https://packagist.org/downloads/", 1052 | "license": [ 1053 | "BSD-3-Clause" 1054 | ], 1055 | "authors": [ 1056 | { 1057 | "name": "Sebastian Bergmann", 1058 | "email": "sebastian@phpunit.de", 1059 | "role": "lead" 1060 | } 1061 | ], 1062 | "description": "Library that helps with managing the version number of Git-hosted PHP projects", 1063 | "homepage": "https://github.com/sebastianbergmann/version", 1064 | "time": "2015-06-21 13:59:46" 1065 | }, 1066 | { 1067 | "name": "symfony/yaml", 1068 | "version": "v2.7.2", 1069 | "source": { 1070 | "type": "git", 1071 | "url": "https://github.com/symfony/Yaml.git", 1072 | "reference": "4bfbe0ed3909bfddd75b70c094391ec1f142f860" 1073 | }, 1074 | "dist": { 1075 | "type": "zip", 1076 | "url": "https://api.github.com/repos/symfony/Yaml/zipball/4bfbe0ed3909bfddd75b70c094391ec1f142f860", 1077 | "reference": "4bfbe0ed3909bfddd75b70c094391ec1f142f860", 1078 | "shasum": "" 1079 | }, 1080 | "require": { 1081 | "php": ">=5.3.9" 1082 | }, 1083 | "require-dev": { 1084 | "symfony/phpunit-bridge": "~2.7" 1085 | }, 1086 | "type": "library", 1087 | "extra": { 1088 | "branch-alias": { 1089 | "dev-master": "2.7-dev" 1090 | } 1091 | }, 1092 | "autoload": { 1093 | "psr-4": { 1094 | "Symfony\\Component\\Yaml\\": "" 1095 | } 1096 | }, 1097 | "notification-url": "https://packagist.org/downloads/", 1098 | "license": [ 1099 | "MIT" 1100 | ], 1101 | "authors": [ 1102 | { 1103 | "name": "Fabien Potencier", 1104 | "email": "fabien@symfony.com" 1105 | }, 1106 | { 1107 | "name": "Symfony Community", 1108 | "homepage": "https://symfony.com/contributors" 1109 | } 1110 | ], 1111 | "description": "Symfony Yaml Component", 1112 | "homepage": "https://symfony.com", 1113 | "time": "2015-07-01 11:25:50" 1114 | } 1115 | ], 1116 | "aliases": [], 1117 | "minimum-stability": "stable", 1118 | "stability-flags": { 1119 | "erb/testing-tools": 20 1120 | }, 1121 | "prefer-stable": false, 1122 | "prefer-lowest": false, 1123 | "platform": { 1124 | "php": ">=5.3.2" 1125 | }, 1126 | "platform-dev": [] 1127 | } 1128 | -------------------------------------------------------------------------------- /subtree/txtthinking/Mailer/phpunit.xml: -------------------------------------------------------------------------------- 1 | 2 | 15 | 16 | 17 | ./tests/ 18 | 19 | 20 | 21 | 22 | vendor 23 | 24 | 25 | 26 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /subtree/txtthinking/Mailer/src/Mailer.php: -------------------------------------------------------------------------------- 1 | smtp = new SMTP($logger); 50 | $this->message = new Message(); 51 | } 52 | 53 | /** 54 | * set server and port 55 | * @param string $host server 56 | * @param int $port port 57 | * @param string $secure ssl tls 58 | * @return $this 59 | */ 60 | public function setServer($host, $port, $secure=null){ 61 | $this->smtp->setServer($host, $port, $secure); 62 | return $this; 63 | } 64 | 65 | /** 66 | * auth with server 67 | * @param string $username 68 | * @param string $password 69 | * @return $this 70 | */ 71 | public function setAuth($username, $password){ 72 | $this->smtp->setAuth($username, $password); 73 | return $this; 74 | } 75 | 76 | /** 77 | * set mail from 78 | * @param string $name 79 | * @param string $email 80 | * @return $this 81 | */ 82 | public function setFrom($name, $email){ 83 | $this->message->setFrom($name, $email); 84 | return $this; 85 | } 86 | 87 | /** 88 | * set fake mail from 89 | * @param string $name 90 | * @param string $email 91 | * @return $this 92 | */ 93 | public function setFakeFrom($name, $email){ 94 | $this->message->setFakeFrom($name, $email); 95 | return $this; 96 | } 97 | 98 | /** 99 | * set mail receiver 100 | * @param string $name 101 | * @param string $email 102 | * @return $this 103 | */ 104 | public function setTo($name, $email){ 105 | $this->message->addTo($name, $email); 106 | return $this; 107 | } 108 | 109 | /** 110 | * add mail receiver 111 | * @param string $name 112 | * @param string $email 113 | * @return $this 114 | */ 115 | public function addTo($name, $email){ 116 | $this->message->addTo($name, $email); 117 | return $this; 118 | } 119 | 120 | /** 121 | * set mail subject 122 | * @param string $subject 123 | * @return $this 124 | */ 125 | public function setSubject($subject){ 126 | $this->message->setSubject($subject); 127 | return $this; 128 | } 129 | 130 | /** 131 | * set mail body 132 | * @param string $body 133 | * @return $this 134 | */ 135 | public function setBody($body){ 136 | $this->message->setBody($body); 137 | return $this; 138 | } 139 | 140 | /** 141 | * set mail attachment 142 | * @param $name 143 | * @param $path 144 | * @return $this 145 | * @internal param string $attachment 146 | */ 147 | public function setAttachment($name, $path){ 148 | $this->message->addAttachment($name, $path); 149 | return $this; 150 | } 151 | 152 | /** 153 | * add mail attachment 154 | * @param $name 155 | * @param $path 156 | * @return $this 157 | * @internal param string $attachment 158 | */ 159 | public function addAttachment($name, $path){ 160 | $this->message->addAttachment($name, $path); 161 | return $this; 162 | } 163 | 164 | /** 165 | * Send the message... 166 | * @return boolean 167 | */ 168 | public function send(){ 169 | return $this->smtp->send($this->message); 170 | } 171 | 172 | } 173 | 174 | -------------------------------------------------------------------------------- /subtree/txtthinking/Mailer/src/Mailer/Exceptions/CodeException.php: -------------------------------------------------------------------------------- 1 | CRLF 83 | * @var string 84 | */ 85 | protected $CRLF = "\r\n"; 86 | 87 | /** 88 | * set mail from 89 | * @param string $name 90 | * @param string $email 91 | * @return $this 92 | */ 93 | public function setFrom($name, $email) 94 | { 95 | $this->fromName = $name; 96 | $this->fromEmail = $email; 97 | return $this; 98 | } 99 | 100 | 101 | /** 102 | * set mail fake from 103 | * @param string $name 104 | * @param string $email 105 | * @return $this 106 | */ 107 | public function setFakeFrom($name, $email) 108 | { 109 | $this->fakeFromName = $name; 110 | $this->fakeFromEmail = $email; 111 | return $this; 112 | } 113 | 114 | /** 115 | * set mail receiver 116 | * @param string $name 117 | * @param string $email 118 | * @return $this 119 | */ 120 | public function setTo($name, $email){ 121 | $this->to[$name] = $email; 122 | return $this; 123 | } 124 | 125 | /** 126 | * add mail receiver 127 | * @param string $name 128 | * @param string $email 129 | * @return $this 130 | */ 131 | public function addTo($name, $email){ 132 | $this->to[$name] = $email; 133 | return $this; 134 | } 135 | 136 | /** 137 | * set mail subject 138 | * @param string $subject 139 | * @return $this 140 | */ 141 | public function setSubject($subject){ 142 | $this->subject = $subject; 143 | return $this; 144 | } 145 | 146 | /** 147 | * set mail body 148 | * @param string $body 149 | * @return $this 150 | */ 151 | public function setBody($body){ 152 | $this->body = $body; 153 | return $this; 154 | } 155 | 156 | /** 157 | * add mail attachment 158 | * @param $name 159 | * @param $path 160 | * @return $this 161 | */ 162 | public function setAttachment($name, $path){ 163 | $this->attachment[$name] = $path; 164 | return $this; 165 | } 166 | 167 | /** 168 | * add mail attachment 169 | * @param $name 170 | * @param $path 171 | * @return $this 172 | */ 173 | public function addAttachment($name, $path){ 174 | $this->attachment[$name] = $path; 175 | return $this; 176 | } 177 | 178 | /** 179 | * @return string 180 | */ 181 | public function getFromName() 182 | { 183 | return $this->fromName; 184 | } 185 | 186 | /** 187 | * @return string 188 | */ 189 | public function getFromEmail() 190 | { 191 | return $this->fromEmail; 192 | } 193 | 194 | 195 | /** 196 | * @return string 197 | */ 198 | public function getFakeFromName() 199 | { 200 | return $this->fakeFromName; 201 | } 202 | 203 | /** 204 | * @return string 205 | */ 206 | public function getFakeFromEmail() 207 | { 208 | return $this->fakeFromEmail; 209 | } 210 | 211 | /** 212 | * @return mixed 213 | */ 214 | public function getTo() 215 | { 216 | return $this->to; 217 | } 218 | 219 | /** 220 | * @return mixed 221 | */ 222 | public function getSubject() 223 | { 224 | return $this->subject; 225 | } 226 | 227 | /** 228 | * @return mixed 229 | */ 230 | public function getBody() 231 | { 232 | return $this->body; 233 | } 234 | 235 | /** 236 | * @return array 237 | */ 238 | public function getAttachment() 239 | { 240 | return $this->attachment; 241 | } 242 | 243 | /** 244 | * Create mail header 245 | * @return $this 246 | */ 247 | protected function createHeader(){ 248 | $this->header['Date'] = date('r'); 249 | 250 | if(!empty($this->fakeFromEmail)){ 251 | $this->header['Return-Path'] = $this->fakeFromEmail; 252 | $this->header['From'] = $this->fakeFromName . " <" . $this->fakeFromEmail . ">"; 253 | } else{ 254 | $this->header['Return-Path'] = $this->fromEmail; 255 | $this->header['From'] = $this->fromName . " <" . $this->fromEmail .">"; 256 | } 257 | 258 | $this->header['To'] = ''; 259 | foreach ($this->to as $toName => $toEmail) { 260 | $this->header['To'] .= $toName . " <" . $toEmail . ">, "; 261 | } 262 | $this->header['To'] = substr($this->header['To'], 0, -2); 263 | $this->header['Subject'] = $this->subject; 264 | $this->header['Message-ID'] = '<' . md5('TX'.md5(time()).uniqid()) . '@' . $this->fromEmail . '>'; 265 | $this->header['X-Priority'] = '3'; 266 | $this->header['X-Mailer'] = 'Mailer (https://github.com/txthinking/Mailer)'; 267 | $this->header['MIME-Version'] = '1.0'; 268 | if (!empty($this->attachment)){ 269 | $this->boundaryMixed = md5(md5(time().'TxMailer').uniqid()); 270 | $this->header['Content-Type'] = "multipart/mixed; \r\n\tboundary=\"" . $this->boundaryMixed . "\""; 271 | } 272 | $this->boundaryAlternative = md5(md5(time().'TXMailer').uniqid()); 273 | return $this; 274 | } 275 | 276 | /** 277 | * @brief createBody create body 278 | * 279 | * @return string 280 | */ 281 | protected function createBody(){ 282 | $in = ""; 283 | $in .= "Content-Type: multipart/alternative; boundary=\"$this->boundaryAlternative\"" . $this->CRLF; 284 | $in .= $this->CRLF; 285 | $in .= "--" . $this->boundaryAlternative . $this->CRLF; 286 | $in .= "Content-Type: text/plain; charset=\"" . $this->charset . "\"" . $this->CRLF; 287 | $in .= "Content-Transfer-Encoding: base64" . $this->CRLF; 288 | $in .= $this->CRLF; 289 | $in .= chunk_split(base64_encode($this->body)) . $this->CRLF; 290 | $in .= $this->CRLF; 291 | $in .= "--" . $this->boundaryAlternative . $this->CRLF; 292 | $in .= "Content-Type: text/html; charset=\"" . $this->charset ."\"" . $this->CRLF; 293 | $in .= "Content-Transfer-Encoding: base64" . $this->CRLF; 294 | $in .= $this->CRLF; 295 | $in .= chunk_split(base64_encode($this->body)) . $this->CRLF; 296 | $in .= $this->CRLF; 297 | $in .= "--" . $this->boundaryAlternative . "--" . $this->CRLF; 298 | return $in; 299 | } 300 | 301 | /** 302 | * @brief createBodyWithAttachment create body with attachment 303 | * 304 | * @return string 305 | */ 306 | protected function createBodyWithAttachment(){ 307 | $in = ""; 308 | $in .= $this->CRLF; 309 | $in .= $this->CRLF; 310 | $in .= '--' . $this->boundaryMixed . $this->CRLF; 311 | $in .= "Content-Type: multipart/alternative; boundary=\"$this->boundaryAlternative\"" . $this->CRLF; 312 | $in .= $this->CRLF; 313 | $in .= "--" . $this->boundaryAlternative . $this->CRLF; 314 | $in .= "Content-Type: text/plain; charset=\"" . $this->charset . "\"" . $this->CRLF; 315 | $in .= "Content-Transfer-Encoding: base64" . $this->CRLF; 316 | $in .= $this->CRLF; 317 | $in .= chunk_split(base64_encode($this->body)) . $this->CRLF; 318 | $in .= $this->CRLF; 319 | $in .= "--" . $this->boundaryAlternative . $this->CRLF; 320 | $in .= "Content-Type: text/html; charset=\"" . $this->charset ."\"" . $this->CRLF; 321 | $in .= "Content-Transfer-Encoding: base64" . $this->CRLF; 322 | $in .= $this->CRLF; 323 | $in .= chunk_split(base64_encode($this->body)) . $this->CRLF; 324 | $in .= $this->CRLF; 325 | $in .= "--" . $this->boundaryAlternative . "--" . $this->CRLF; 326 | foreach ($this->attachment as $name => $path){ 327 | $in .= $this->CRLF; 328 | $in .= '--' . $this->boundaryMixed . $this->CRLF; 329 | $in .= "Content-Type: application/octet-stream; name=\"". $name ."\"" . $this->CRLF; 330 | $in .= "Content-Transfer-Encoding: base64" . $this->CRLF; 331 | $in .= "Content-Disposition: attachment; filename=\"" . $name . "\"" . $this->CRLF; 332 | $in .= $this->CRLF; 333 | $in .= chunk_split(base64_encode(file_get_contents($path))) . $this->CRLF; 334 | } 335 | $in .= $this->CRLF; 336 | $in .= $this->CRLF; 337 | $in .= '--' . $this->boundaryMixed . '--' . $this->CRLF; 338 | return $in; 339 | } 340 | 341 | public function toString(){ 342 | $in = ''; 343 | $this->createHeader(); 344 | foreach ($this->header as $key => $value) { 345 | $in .= $key . ': ' . $value . $this->CRLF; 346 | } 347 | if (empty($this->attachment)) { 348 | $in .= $this->createBody(); 349 | } else { 350 | $in .= $this->createBodyWithAttachment(); 351 | } 352 | $in .= $this->CRLF . $this->CRLF . "." . $this->CRLF; 353 | return $in; 354 | } 355 | 356 | } 357 | -------------------------------------------------------------------------------- /subtree/txtthinking/Mailer/src/Mailer/SMTP.php: -------------------------------------------------------------------------------- 1 | CRLF 66 | * @var string 67 | */ 68 | protected $CRLF = "\r\n"; 69 | 70 | /** 71 | * @var Message 72 | */ 73 | protected $message; 74 | 75 | /** 76 | * @var LoggerInterface - Used to make things prettier than self::$logger 77 | */ 78 | protected $logger; 79 | 80 | /** 81 | * Stack of all commands issued to SMTP 82 | * @var array 83 | */ 84 | protected $commandStack = array(); 85 | 86 | /** 87 | * Stack of all results issued to SMTP 88 | * @var array 89 | */ 90 | protected $resultStack = array(); 91 | 92 | public function __construct(LoggerInterface $logger=null) 93 | { 94 | $this->logger = $logger; 95 | } 96 | 97 | /** 98 | * set server and port 99 | * @param string $host server 100 | * @param int $port port 101 | * @param string $secure ssl tls 102 | * @return $this 103 | */ 104 | public function setServer($host, $port, $secure=null) 105 | { 106 | $this->host = $host; 107 | $this->port = $port; 108 | $this->secure = $secure; 109 | if(!$this->ehlo) $this->ehlo = $host; 110 | $this->logger && $this->logger->debug("Set: the server"); 111 | return $this; 112 | } 113 | 114 | /** 115 | * auth with server 116 | * @param string $username 117 | * @param string $password 118 | * @return $this 119 | */ 120 | public function setAuth($username, $password){ 121 | $this->username = $username; 122 | $this->password = $password; 123 | $this->logger && $this->logger->debug("Set: the auth"); 124 | return $this; 125 | } 126 | 127 | /** 128 | * set the EHLO message 129 | * @param $ehlo 130 | * @return $this 131 | */ 132 | public function setEhlo($ehlo){ 133 | $this->ehlo = $ehlo; 134 | return $this; 135 | } 136 | 137 | /** 138 | * Send the message 139 | * 140 | * @param Message $message 141 | * @return $this 142 | * @throws CodeException 143 | * @throws CryptoException 144 | * @throws SMTPException 145 | */ 146 | public function send(Message $message){ 147 | $this->logger && $this->logger->debug('Set: a message will be sent'); 148 | $this->message = $message; 149 | $this->connect() 150 | ->ehlo(); 151 | 152 | if ($this->secure === 'tls'){ 153 | $this->starttls() 154 | ->ehlo(); 155 | } 156 | $this->authLogin() 157 | ->mailFrom() 158 | ->rcptTo() 159 | ->data() 160 | ->quit(); 161 | return fclose($this->smtp); 162 | } 163 | 164 | /** 165 | * connect the server 166 | * SUCCESS 220 167 | * @return $this 168 | * @throws CodeException 169 | * @throws SMTPException 170 | */ 171 | protected function connect(){ 172 | $this->logger && $this->logger->debug("Connecting to {$this->host} at {$this->port}"); 173 | $host = ($this->secure == 'ssl') ? 'ssl://' . $this->host : $this->host; 174 | $this->smtp = @fsockopen($host, $this->port); 175 | //set block mode 176 | // stream_set_blocking($this->smtp, 1); 177 | if (!$this->smtp){ 178 | throw new SMTPException("Could not open SMTP Port."); 179 | } 180 | $code = $this->getCode(); 181 | if ($code !== '220'){ 182 | throw new CodeException('220', $code, array_pop($this->resultStack)); 183 | } 184 | return $this; 185 | } 186 | 187 | /** 188 | * SMTP STARTTLS 189 | * SUCCESS 220 190 | * @return $this 191 | * @throws CodeException 192 | * @throws CryptoException 193 | * @throws SMTPException 194 | */ 195 | protected function starttls(){ 196 | $in = "STARTTLS" . $this->CRLF; 197 | $code = $this->pushStack($in); 198 | if ($code !== '220'){ 199 | throw new CodeException('220', $code, array_pop($this->resultStack)); 200 | } 201 | if(!stream_socket_enable_crypto($this->smtp, true, STREAM_CRYPTO_METHOD_TLS_CLIENT)) { 202 | throw new CryptoException("Start TLS failed to enable crypto"); 203 | } 204 | return $this; 205 | } 206 | 207 | /** 208 | * SMTP EHLO 209 | * SUCCESS 250 210 | * @return $this 211 | * @throws CodeException 212 | * @throws SMTPException 213 | */ 214 | protected function ehlo(){ 215 | $in = "EHLO " . $this->ehlo . $this->CRLF; 216 | $code = $this->pushStack($in); 217 | if ($code !== '250'){ 218 | throw new CodeException('250', $code, array_pop($this->resultStack)); 219 | } 220 | return $this; 221 | } 222 | 223 | /** 224 | * SMTP AUTH LOGIN 225 | * SUCCESS 334 226 | * SUCCESS 334 227 | * SUCCESS 235 228 | * @return $this 229 | * @throws CodeException 230 | * @throws SMTPException 231 | */ 232 | protected function authLogin() 233 | { 234 | if ($this->username === null && $this->password === null) { 235 | // Unless the user has specifically set a username/password 236 | // Do not try to authorize. 237 | return $this; 238 | } 239 | 240 | $in = "AUTH LOGIN" . $this->CRLF; 241 | $code = $this->pushStack($in); 242 | if ($code !== '334'){ 243 | throw new CodeException('334', $code, array_pop($this->resultStack)); 244 | } 245 | $in = base64_encode($this->username) . $this->CRLF; 246 | $code = $this->pushStack($in); 247 | if ($code !== '334'){ 248 | throw new CodeException('334', $code, array_pop($this->resultStack)); 249 | } 250 | $in = base64_encode($this->password) . $this->CRLF; 251 | $code = $this->pushStack($in); 252 | if ($code !== '235'){ 253 | throw new CodeException('235', $code, array_pop($this->resultStack)); 254 | } 255 | return $this; 256 | } 257 | 258 | /** 259 | * SMTP MAIL FROM 260 | * SUCCESS 250 261 | * @return $this 262 | * @throws CodeException 263 | * @throws SMTPException 264 | */ 265 | protected function mailFrom(){ 266 | $in = "MAIL FROM:<{$this->message->getFromEmail()}>" . $this->CRLF; 267 | $code = $this->pushStack($in); 268 | if ($code !== '250') { 269 | throw new CodeException('250', $code, array_pop($this->resultStack)); 270 | } 271 | return $this; 272 | } 273 | 274 | /** 275 | * SMTP RCPT TO 276 | * SUCCESS 250 277 | * @return $this 278 | * @throws CodeException 279 | * @throws SMTPException 280 | */ 281 | protected function rcptTo(){ 282 | foreach ($this->message->getTo() as $toEmail) { 283 | $in = "RCPT TO:<" . $toEmail . ">" . $this->CRLF; 284 | $code = $this->pushStack($in); 285 | if ($code !== '250') { 286 | throw new CodeException('250', $code, array_pop($this->resultStack)); 287 | } 288 | } 289 | return $this; 290 | } 291 | 292 | /** 293 | * SMTP DATA 294 | * SUCCESS 354 295 | * SUCCESS 250 296 | * @return $this 297 | * @throws CodeException 298 | * @throws SMTPException 299 | */ 300 | protected function data(){ 301 | $in = "DATA" . $this->CRLF; 302 | $code = $this->pushStack($in); 303 | if ($code !== '354') { 304 | throw new CodeException('354', $code, array_pop($this->resultStack)); 305 | } 306 | $in = $this->message->toString(); 307 | $code = $this->pushStack($in); 308 | if ($code !== '250'){ 309 | throw new CodeException('250', $code, array_pop($this->resultStack)); 310 | } 311 | return $this; 312 | } 313 | 314 | /** 315 | * SMTP QUIT 316 | * SUCCESS 221 317 | * @return $this 318 | * @throws CodeException 319 | * @throws SMTPException 320 | */ 321 | protected function quit(){ 322 | $in = "QUIT" . $this->CRLF; 323 | $code = $this->pushStack($in); 324 | if ($code !== '221'){ 325 | throw new CodeException('221', $code, array_pop($this->resultStack)); 326 | } 327 | return $this; 328 | } 329 | 330 | protected function pushStack($string) 331 | { 332 | $this->commandStack[] = $string; 333 | fputs($this->smtp, $string, strlen($string)); 334 | $this->logger && $this->logger->debug('Sent: '. $string); 335 | return $this->getCode(); 336 | } 337 | 338 | /** 339 | * get smtp response code 340 | * once time has three digital and a space 341 | * @return string 342 | * @throws SMTPException 343 | */ 344 | protected function getCode() { 345 | while ($str = fgets($this->smtp, 515)) { 346 | $this->logger && $this->logger->debug("Got: ". $str); 347 | $this->resultStack[] = $str; 348 | if(substr($str,3,1) == " ") { 349 | $code = substr($str,0,3); 350 | return $code; 351 | } 352 | } 353 | throw new SMTPException("SMTP Server did not respond with anything I recognized"); 354 | } 355 | 356 | } 357 | 358 | -------------------------------------------------------------------------------- /subtree/txtthinking/Mailer/tests/MailerTest.php: -------------------------------------------------------------------------------- 1 | smtp = new SMTP(new Logger('SMTP')); 16 | $this->message = new Message(); 17 | } 18 | 19 | public function testSMTP(){ 20 | $this->smtp 21 | ->setServer('smtp.ym.163.com', 25) 22 | ->setAuth('bot@ym.txthinking.com', ''); // email, password 23 | 24 | $this->message 25 | ->setFrom('Tom', 'bot@ym.txthinking.com') // your name, your email 26 | ->setFakeFrom('heelo', 'bot@hello.com') // a fake name, a fake email 27 | ->addTo('Cloud', 'cloud@txthinking.com') 28 | ->setSubject('Test SMTP ' . time()) 29 | ->setBody('

for test

') 30 | ->addAttachment('host', '/etc/hosts'); 31 | 32 | $status = $this->smtp->send($this->message); 33 | $this->assertTrue($status); 34 | } 35 | 36 | public function testSend(){ 37 | $status = (new Mailer(new Logger('Mailer'))) 38 | ->setServer('smtp.ym.163.com', 25) 39 | ->setAuth('bot@ym.txthinking.com', '') // email, password 40 | ->setFrom('Tom', 'bot@ym.txthinking.com') // your name, your email 41 | ->setFakeFrom('张全蛋', 'zhangquandan@hello.com') // a fake name, a fake email 42 | ->addTo('Cloud', 'cloud@txthinking.com') 43 | ->setSubject('hello '. time()) 44 | ->setBody('Hi, boy') 45 | ->addAttachment('host', '/etc/hosts') 46 | ->send(); 47 | $this->assertTrue($status); 48 | } 49 | 50 | } 51 | 52 | -------------------------------------------------------------------------------- /subtree/txtthinking/Mailer/tests/SMTPTest.php: -------------------------------------------------------------------------------- 1 | smtp = new SMTP(); 35 | $this->testHelper = new TestHelper(); 36 | 37 | } 38 | 39 | public function testSetServer() 40 | { 41 | $result = $this->smtp->setServer("localhost", "25", null); 42 | $this->assertEquals('localhost', $this->testHelper->getPropertyValue($this->smtp, 'host')); 43 | $this->assertEquals('25', $this->testHelper->getPropertyValue($this->smtp, 'port')); 44 | $this->assertSame($this->smtp, $result); 45 | } 46 | 47 | public function testSetAuth() 48 | { 49 | $result = $this->smtp->setAuth('none', 'none'); 50 | 51 | $this->assertEquals('none', $this->testHelper->getPropertyValue($this->smtp, 'username')); 52 | $this->assertEquals('none', $this->testHelper->getPropertyValue($this->smtp, 'password')); 53 | $this->assertSame($this->smtp, $result); 54 | } 55 | 56 | public function testMessage() 57 | { 58 | $this->smtp->setServer("localhost", "25", null) 59 | ->setAuth('none', 'none'); 60 | 61 | $message = new Message(); 62 | $message->setFrom('You', 'nobody@nowhere.no') 63 | ->setTo('Them', 'them@nowhere.no') 64 | ->setSubject('This is a test') 65 | ->setBody('This is a test part two'); 66 | 67 | $status = $this->smtp->send($message); 68 | $this->assertTrue($status); 69 | } 70 | 71 | 72 | /** 73 | * @expectedException \Tx\Mailer\Exceptions\SMTPException 74 | */ 75 | public function testConnectSMTPException() 76 | { 77 | $this->smtp->setServer("localhost", "99999", null) 78 | ->setAuth('none', 'none'); 79 | $message = new Message(); 80 | $message->setFrom('You', 'nobody@nowhere.no') 81 | ->setTo('Them', 'them@nowhere.no') 82 | ->setSubject('This is a test') 83 | ->setBody('This is a test part two'); 84 | 85 | $this->smtp->send($message); 86 | 87 | } 88 | 89 | 90 | } 91 | -------------------------------------------------------------------------------- /subtree/txtthinking/Mailer/tests/TestCase.php: -------------------------------------------------------------------------------- 1 |