Why this LINQ throws NullReferenceException?
===

    private SmtpClient getServer()
            {
                return (from e in doc.Elements("emailsetting")
                        select new SmtpClient()
                        {
                            Host = e.Attribute("server").Value,
                            Port = Convert.ToInt32(e.Attribute("port").Value)
                        }).FirstOrDefault();
            }

The xml config file:

      <emailsetting>
        <stmp server="10.182.182.182" port="25" />
        <from address="ithelpdest@citics.com.hk"/>
        <to address=""/>
        <cc address=""/>
      </emailsetting>

Why throws the exception:
NullReferenceException was unhandled
Object reference not set to an instance of an object.

I'm new to LINQ,plz help.