Code for validating emails


When importing data in bulk to Hubspot, Hubspot apparently runs a check to make sure that all emails are valid. If it encounters any invalid emails, the entire import is stopped. This creates issues when scheduling and relying upon our daily imports/updates with our user base, b/c invariably Hubspot will encounter 1 or 2 bad emails every week or so.

My development team would like to add this exact email validation check to our end, before exporting to Hubspot, so that we don’t trip the Hubspot import error. But I haven’t been able to figure out how Hubspot is validating emails. Does anyone know what algorithm Hubspot is using to determine whether an email is valid? Where can we find this? Or are there any good alternatives to filtering our emails of an invalid format/type? Thanks!


Hi @ttepichin

You can find the rules we use to validate the format of the email address here: