Index: src/wp-includes/pluggable.php
===================================================================
--- src/wp-includes/pluggable.php	(revision 41150)
+++ src/wp-includes/pluggable.php	(working copy)
@@ -327,7 +327,12 @@
 
 	if ( !isset( $from_email ) ) {
 		// Get the site domain and get rid of www.
-		$sitename = strtolower( $_SERVER['SERVER_NAME'] );
+		// If SERVER_NAME is not available, hostname will be used.
+		if ( !empty ( $_SERVER['SERVER_NAME'] ) ) {
+		    $sitename = strtolower( $_SERVER['SERVER_NAME'] );
+		} else {
+		    $sitename = strtolower( php_uname( 'n' ));
+		}
 		if ( substr( $sitename, 0, 4 ) == 'www.' ) {
 			$sitename = substr( $sitename, 4 );
 		}
