Changeset 26
- Timestamp:
- 13.04.2007 17:10:39 (2 years ago)
- Files:
-
- trunk/mailer.class.php (modified) (2 diffs)
- trunk/smtp.class.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/mailer.class.php
r22 r26 38 38 } 39 39 40 if( isset($_SERVER['SERVER_NAME']) ) { 41 $hostname = $_SERVER['SERVER_NAME']; 42 } 43 else if( !($hostname = @php_uname('n')) ) { 44 $hostname = 'localhost'; 40 if( !($hostname = @php_uname('n')) ) { 41 $hostname = isset($_SERVER['SERVER_NAME']) ? $_SERVER['SERVER_NAME'] : 'localhost'; 45 42 } 46 43 … … 183 180 public static function send(Email $email) 184 181 { 185 $email->headers->set('X-Mailer', sprintf('Wamailer/% .1f', self::VERSION));182 $email->headers->set('X-Mailer', sprintf('Wamailer/%s', self::VERSION)); 186 183 187 184 $rPath = $email->headers->get('Return-Path'); trunk/smtp.class.php
r24 r26 117 117 } 118 118 119 if( isset($_SERVER['SERVER_NAME']) ) { 120 $domain = $_SERVER['SERVER_NAME']; 121 } 122 else if( !($domain = @php_uname('n')) ) { 123 $domain = 'localhost'; 119 if( !($hostname = @php_uname('n')) ) { 120 $hostname = isset($_SERVER['SERVER_NAME']) ? 121 $_SERVER['SERVER_NAME'] : 'localhost'; 124 122 } 125 123 … … 149 147 // Code error : 500, 501, 504, 421 150 148 // 151 $this->put(sprintf("EHLO %s\r\n", $ domain));149 $this->put(sprintf("EHLO %s\r\n", $hostname)); 152 150 if( !$this->checkResponse(250) ) { 153 $this->put(sprintf("HELO %s\r\n", $ domain));151 $this->put(sprintf("HELO %s\r\n", $hostname)); 154 152 if( !$this->checkResponse(250) ) { 155 153 return false;
