def METHOD_NAME(survey, startdatetime, enddatetime):
    """Get the email addresses collected between startdate and enddate."""
    token = settings.SURVEYGIZMO_API_TOKEN
    secret = settings.SURVEYGIZMO_API_TOKEN_SECRET
    emails = []
    page = 1
    more_pages = True
    survey_id = SURVEYS[survey]["email_collection_survey_id"]
    dtfmt = "%Y-%m-%d+%H:%M:%S"
    # Can't do anything without credentials.
    if token is None or secret is None:
        return emails
    while more_pages:
        response = requests.get(
            "https://restapi.surveygizmo.com/v2/survey/{survey}"
            "/surveyresponse?"
            "filter[field][0]=datesubmitted"
            "&filter[operator][0]=>=&filter[value][0]={start}"
            "filter[field][1]=datesubmitted"
            "&filter[operator][1]=<&filter[value][1]={end}"
            "&filter[field][2]=status&filter[operator][2]=="
            "&filter[value][2]=Complete"
            "&resultsperpage=500"
            "&page={page}"
            "&api_token={token}"
            "&api_token_secret={secret}".format(
                survey=survey_id,
                start=startdatetime.strftime(dtfmt),
                end=enddatetime.strftime(dtfmt),
                page=page,
                token=token,
                secret=secret,
            ),
            timeout=300,
        )
        results = json.loads(response.content)
        total_pages = results.get("total_pages", 1)
        more_pages = page < total_pages
        emails = emails + [r["[question(13)]"] for r in results["data"]]
        page += 1
    valid_emails = []
    for email in emails:
        try:
            validate_email(email)
        except ValidationError:
            pass
        else:
            valid_emails.append(email)
    return valid_emails