diff --git a/system/libraries/Email.php b/system/libraries/Email.php
index 55edd62..99de174 100644
--- a/system/libraries/Email.php
+++ b/system/libraries/Email.php
@@ -1548,7 +1548,7 @@
 	 */		
 	function _get_hostname()
 	{	
-		return ($this->smtp_host != '') ? $this->smtp_host : $this->_get_ip();		
+		return (isset($_SERVER['SERVER_NAME'])) ? $_SERVER['SERVER_NAME'] : 'localhost.localdomain';	
 	}
   	// END _get_hostname()