title: python: correct method verify if email exists
body: <p>I am trying to verify if an email actually exists by first resolving its dns, then check if the email is valid using the below code:</p>
  
  <pre><code>    email = test@cisco.com
      domain = email.split("@")[-1]
      records = dns.resolver.query(domain, 'MX')
      mxRecord = records[0].exchange
      mxRecord = str(mxRecord)
      server.connect(mxRecord)
      server.helo(host)
      server.mail('myemail@gmail.com')
      code, message = server.rcpt(str(email))
      server.quit()
      if code == 250:
          print('valid email', message) 
      else:
          print('invalid email', message)
  </code></pre>
  
  <p>This works few times, but when I send multiple request I get a message like:</p>
  
  <blockquote>
    <p>"5.7.1 Service unavailable, Client host [122.166.xxx.xxx] blocked using
    Spamhaus. To request removal from this list see
    <a href="http://www.spamhaus.org/lookup.lasso" rel="noreferrer">http://www.spamhaus.org/lookup.lasso</a> (AS160312312)
    [BL2NAM02FT12312.eop-nam02.prod.protection.outlook.com]'"</p>
  </blockquote>
  
  <p>I understand that they are trying to block my ip address as it thinks its spammy.</p>
  
  <p>Here are my questions:</p>
  
  <ul>
  <li>Is there a right way to do this type of email validation, without getting marked as spam? Is it getting marked as spam as I am running the code on my system and just giving a dummy value for email like</li>
  </ul>
  
  <blockquote>
    <p>server.mail('myemail@gmail.com')</p>
  </blockquote>
  
  <ul>
  <li>Is it possible to use some proxy to do this? My usecase require 100's of email addresses to be verified. I see some commercial api available for email validation, but it is not feasible for me at the moment.</li>
  </ul>