networking error in Ethernet shield

sir i am trying to connect Ethernet shield with my local email server for sending email.when i compile program and serial monitor…its connecting with server but not sending email.kindly help…source file and error is attached.

new_code_for_server_room_email_alkaram_email_.ino (8.83 KB)

Change your evaluation of the return value from the connect to this:

  int rtnval = client.connect("email.alkaram.com",465)

  if(rtnval == 1)
  {
    Serial.println("connected");
  } else {
    Serial.print("connection failed ");
    Serial.println(rtnval);
    return 0;
  }

If the return value is 0, then the dns resolution was successful, but couldn't connect to the server.
If the return value is less than 0 (negative), then the dns failed.

  if (client.connect("email.alkaram.com",465))

Port 465 usually is the used to deliver emails by SMTPS, the SSL secured version. An Arduino is not able to handle an SSL connection. You should look out for another possibility to deliver your emails.

If you're sending the mails only to yourself, you might try to deliver to port 25 directly to the MX host of your provider (mail.alkaram.com in your case). Remove the SMTP AUTH section in that case.