problems with arduino ethernet and its SD card

anyone knows why when you use the arduino ethernet like a server you can not to use the SD card to save some event or if do you want send a email by some event and do you want to monitoring the state of arduino ethernet at the same time in only one sketch do not works I attached the part of my code because the all functions that I wanted to work I think both are more important to me.

if do you separate test it works but the problem is when do you want to work both at the same time

thanks for help me.

void loop() 
{
  internet();
  if ((estadosensor = digitalRead(sensor)) == 1)  email();
}

/****************************************************************/
void internet()
{
EthernetClient client = server.available();
  if (client) {
    boolean currentLineIsBlank = true;
    while (client.connected()) {
      if (client.available()) {
        char c = client.read();
        if (c == '\n' && currentLineIsBlank) {
          client.println("HTTP/1.1 200 OK");
          client.println("Content-Type: text/html");
          client.println("Connection: close");
          client.println();
          client.println("<!DOCTYPE HTML>");
          client.println("<html>");                    
          client.println("<meta http-equiv=\"refresh\" content=\"5\">");
          client.println("
");
          client.println("
");
          client.println("<center>ARDUINO ETHERNET</center>");
          client.println("
");
          client.println("
");
          myfile = SD.open("datalog.txt");
          if (myfile)
          {
            while(myfile.available()) 
            {
              client.write(myfile.read());
            }
            client.println("
");
            client.println();
          }
          myfile.close();
          client.println("</html>");
          break;
        }
        if (c == '\n') {
          currentLineIsBlank = true;
        } 
        else if (c != '\r') {
          currentLineIsBlank = false;
        }
      }
    }
    delay(1);
    client.stop();
  }
}

/****************************************************************/
void email()
{
  if (client.connect(smtp,8025)) //2525/25/8025/587/465/8465 // I tried with all ports and works
  {
    delay(500);
    client.println("ehlo");
    delay(500);
    client.println("auth login");     
    delay(500);
    client.println("xxxxxxxxxxxxxxxxxxxx");          
    delay(500);
    client.println("xxxxxxxxxxxxxxxxxxxx"); 
    delay(500);    
    client.println("mail from: xxxxxxxxxxx@gmail.com");  
    delay(500);
    client.println("rcpt to: xxxxxxxxxxx@hotmail.com");
    delay(500);
    client.println("data");
    delay(500);
    client.println("To: XXXXXXX");
    delay(500);
    client.println("From: XXXXXXX");
    delay(500);
    client.println("Subject: MENSAJE DE PRUEBA");
    delay(500);
    client.println();
    delay(500);
    client.println("**************");
    delay(500);
    client.println("ALERTA SENSOR ACTIVO");
    delay(500);
    client.println("**************");
    delay(500);
    client.println(".");
    delay(500);
    client.println("quit");
  } 
  else 
  {
    client.stop();
  } 
}

You should post all your code. Here are mine.

Web server.
http://playground.arduino.cc/Code/WebServerST

Email client.
http://playground.arduino.cc/Code/Email

FTP client(w5100 and SD working together).
http://playground.arduino.cc/Code/FTP

You may be running a bit low on SRAM with an Uno-type processor. 2K doesn't go far. You will certainly need the F() macro for those static strings. Look at any of those sketches for an example.

anyone knows why when you use the arduino ethernet like a server you can not to use the SD card to save some event

You can. I do.