title: Python How to accept only certain words with user input
body: <p>Ok so The script is now working, Id like to thank all for the advice.</p>
  
  <p>heres the final script</p>
  
  <pre><code>import smtplib 
  import xbmc
  import xbmcgui
  import datetime
  
  list = ("mary", "james", "tilly")
  
  kb = xbmc.Keyboard('', 'Please type in your name to continue')
  kb.doModal()
  typedin = kb.getText()
  
  if typedin.lower() in list:
      now = datetime.datetime.now()
      runtime = now.strftime("%Y-%m-%d %H:%M")
  
      content = xbmc.executebuiltin('kb.getText()')
      mailserver = smtplib.SMTP("smtp.mail.com",25)
      mailserver.ehlo()
      mailserver.starttls()
      mailserver.login('mail@somemail.com','somepwd')
      mailserver.sendmail('mail@somemail.com','mail@somemail.com',typedin + ' has run proggy ' + runtime)
      mailserver.close()
      xbmc.executebuiltin("Notification(An email has been sent, yada yada yada,()")
  else:
      xbmc.executebuiltin("THE INPUTTED NAME, IS NOT VALID,()")
      xbmcgui.Dialog().ok(
      "Please try again - User name not correct",
      "The input yada yada",
      "yada yada",
      "yada yada")
  </code></pre>
  
  <p>So, just to let you know that im using live mail which works on port 25.
  Tried and tested on both windows and linux and openelec. Working fine.</p>