Need help with my LCD after running a function

Okay, so my project is supposed to email someone after a certain temperature is reached or a button is pressed, it all works out great except the LCD that displays the current temperature screws up after the arduino runs the "sendMail" function i set up... After it's run the LCD goes blank and then displays "N" and stays like that even after the sendMail function is finished. Could someone help me out?

#include <LiquidCrystal.h>


#include <SPI.h>
#include <Ethernet.h>
#include <Wire.h>
// Enter a MAC address and IP address for your controller below.
// The IP address will be dependent on your local network:
byte mac[] = {  
  0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
byte ip[] = { 192,168,101,165 };
byte gateway[] = {192,168,101,1};
byte subnet[] ={255,255,255,0};

// Enter the IP address of the server you're connecting to:
byte server[] = { 192,168,101,9 }; 



Client client(server, 25);
const int buttonPin = 2;   
int buttonState = 0; 

LiquidCrystal lcd(7, 8, 9, 10, 11, 12);

int tmp102Address = 0x48;
byte res;
int val;

void setup() {


     lcd.begin(16, 2);  
  Serial.begin(9600);
    Wire.begin();

    
}



//main loop
void loop()
{

  buttonState = digitalRead(buttonPin);


  // as long as there are bytes in the serial queue,
  // read them and send them out the socket if it's open:
  while (Serial.available() > 0) {
    char inChar = Serial.read();
    if (client.connected()) {
      client.print(inChar); 
    }
  }
  
  
  Wire.requestFrom(tmp102Address,2); 

  byte MSB = Wire.receive();
  byte LSB = Wire.receive();

  int TemperatureSum = ((MSB << 8) | LSB) >> 4; //it's a 12bit int, using two's compliment for negative

  float celsius = TemperatureSum*0.0625;
  float fahrenheit = (TemperatureSum*0.1125) + 32;  

  if (buttonState == HIGH||fahrenheit > 77) {
    sendMail();
  }


  lcd.print("F:");
  lcd.setCursor(2,0);
  lcd.print(fahrenheit);
  lcd.setCursor(0,1);
  lcd.print("C:");
  lcd.setCursor(2,1);
  lcd.print(celsius);
  delay(500);
  lcd.clear();
}






//SEND MAIL FUNCTION
void sendMail()
{
      // start the Ethernet connection:
    Ethernet.begin(mac, ip,gateway,subnet);

    Serial.println("connecting...");

    // if you get a connection, report back via serial:
    if (client.connect()) {  
        Serial.println("connected");
        client.println("ehlo person"); /* terminate connection */
        delay(1000);
        client.println("auth login"); /* terminate connection */
        delay(1000);
        client.println("YXJkaQ=="); /* terminate connection */
        delay(1000);
        client.println("YXJkaTEx"); /* terminate connection */
        delay(1000);
        client.println("YXJkaTEx"); /* terminate connection */
        delay(1000);
        client.println("MAIL FROM:Ardi@lgit.org"); /* terminate connection */
        delay(1000);
        client.println("RCPT TO:Mbecker@lgit.org"); /* terminate connection */
        delay(1000);
        client.println("RCPT TO:Legnox@gmail.com"); /* terminate connection */
        delay(1000);

        client.println("DATA"); /* terminate connection */
        delay(1000);
        client.println("SUBJECT:Test message from Ardi!"); /* terminate connection */
        delay(1000);
            
        client.println("The temperature of the room is"); /* terminate connection */
        delay(1000);

        client.println("."); /* terminate connection */
        delay(1000);
        client.println("QUIT"); /* terminate connection */

  } 
  else {
    // if you didn't get a connection to the server:

    Serial.println("connection failed");
  }
  
  Serial.println();
  Serial.println("disconnecting.");
  client.stop();
}

For starters - you should only use lcd.begin() once, in setup.

Don

Yeah. I thought i took that out. It was a shot in the dark thing trying to fix it x)

from the ethernet shield documentation:
Arduino communicates with both the W5100 and SD card using the SPI bus (through the ICSP header). This is on digital pins 11, 12, and 13

from your code:

LiquidCrystal lcd(7, 8, 9, 10, 11, 12);

It is possible to share the LCD data lines with other devices but it isn't a good idea unless (1) you really have to, and (2) you really know what you are doing.

Don

This might be a good place to remind you that the "analog pins" can also be used as digital pins, since you are probably nearly out of the 'digital pins'. the standard Arduinos use these numbers when you refer to the Analog pins as digital:
A0 = 14;
A1 = 15;
A2 = 16;
A3 = 17;
A4 = 18;
A5 = 19;
A6 = 20;
A7 = 21;

Alrighty! I'll give the switch of pins a go : ) thanks for the help! The ethernet shield's pins totally slipped my mind...

Thinking about this kind of bug a little more, it seems to me that the way stackable headers bring all the pins forward for potential reuse is part of the issue. It might be good practice when one first gets a new shield and carefully reads the documentation to PLUG the used sockets in some way to remind one's later self. It should probably be a removable way, since as Don points out, if you are really careful you can reuse the pins.

You can also consider getting a serial back pack for the LCD so you only need 2 pins to control it.