Untitled

mail@pastecode.io avatar
unknown
plain_text
a month ago
7.8 kB
2
Indexable
Never
import requests

def send_emails(to_email1, to_email2, line_number):
    cookies = {
    'wroute': 'f3709f48429b9002478fde33a39c700d',
    'TIMEZONE_COOKIE': 'UTC',
    'JSESSIONID': 'eaaFmFYhMlZcn62k_th0y',
    'email': 'IVDV9EgO_o0JjrVGs6DLbkrr0Nc5fuJEE6FTyqULHBE=',
    'language': 'z3S103x9ORFGExsVRNPrOg==',
    'User.REMEMBER_ME_COOKIE': 'IVDV9EgO_o0JjrVGs6DLbkrr0Nc5fuJEE6FTyqULHBE=',
    'domainCookie': 'SmmFyHBt_zutCb5Ma0eGLA==',
    '__adroll_fpc': '5e2bfe9b8714dd7658dea77e3c8fd302-1705329771375',
    '__ar_v4': '%7CKCWOQFHKUZF3BJ4ARRVJFH%3A20240114%3A1%7CGVVGIIR7PRESXB7GR5WLNB%3A20240114%3A1%7CPA3XKUXHCRFH3EPV3A5SMH%3A20240114%3A1',
    'SignUpReferrer': 'https://www.surveyanalytics.com/a/userEmailVerification.do?mode=surveyanalytics&lat=eMvJSSOWSoa4aDs%2BgRlqUf7mhCXC5MVunCD17xWg5aMECHrPeIW9eQ%3D%3D',
    'landingURL': 'https://www.surveyanalytics.com/a/userEmailVerification.do?mode=surveyanalytics&lat=eMvJSSOWSoa4aDs%2BgRlqUf7mhCXC5MVunCD17xWg5aMECHrPeIW9eQ%3D%3D',
    'SAWEBSER': 'sawa2|ZaVFN',
}


    headers = {
    'authority': 'www.surveyanalytics.com',
    'accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7',
    'accept-language': 'en-US,en;q=0.9',
    'cache-control': 'max-age=0',
    'content-type': 'application/x-www-form-urlencoded',
    # 'cookie': 'wroute=f3709f48429b9002478fde33a39c700d; TIMEZONE_COOKIE=UTC; JSESSIONID=eaaFmFYhMlZcn62k_th0y; email=IVDV9EgO_o0JjrVGs6DLbkrr0Nc5fuJEE6FTyqULHBE=; language=z3S103x9ORFGExsVRNPrOg==; User.REMEMBER_ME_COOKIE=IVDV9EgO_o0JjrVGs6DLbkrr0Nc5fuJEE6FTyqULHBE=; domainCookie=SmmFyHBt_zutCb5Ma0eGLA==; __adroll_fpc=5e2bfe9b8714dd7658dea77e3c8fd302-1705329771375; __ar_v4=%7CKCWOQFHKUZF3BJ4ARRVJFH%3A20240114%3A1%7CGVVGIIR7PRESXB7GR5WLNB%3A20240114%3A1%7CPA3XKUXHCRFH3EPV3A5SMH%3A20240114%3A1; SignUpReferrer=https://www.surveyanalytics.com/a/userEmailVerification.do?mode=surveyanalytics&lat=eMvJSSOWSoa4aDs%2BgRlqUf7mhCXC5MVunCD17xWg5aMECHrPeIW9eQ%3D%3D; landingURL=https://www.surveyanalytics.com/a/userEmailVerification.do?mode=surveyanalytics&lat=eMvJSSOWSoa4aDs%2BgRlqUf7mhCXC5MVunCD17xWg5aMECHrPeIW9eQ%3D%3D; SAWEBSER=sawa2|ZaVFN',
    'origin': 'https://www.surveyanalytics.com',
    'referer': 'https://www.surveyanalytics.com/a/showDistribution.do?mode=link&m=IN_Distribution&surveyID=3359381',
    'sec-ch-ua': '"Not_A Brand";v="8", "Chromium";v="120", "Google Chrome";v="120"',
    'sec-ch-ua-mobile': '?0',
    'sec-ch-ua-platform': '"Windows"',
    'sec-fetch-dest': 'document',
    'sec-fetch-mode': 'navigate',
    'sec-fetch-site': 'same-origin',
    'sec-fetch-user': '?1',
    'upgrade-insecure-requests': '1',
    'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36',
}


    
    data = [
    ('mode', 'send'),
    ('addressBook', 'true'),
    ('originalBatchID', '0'),
    ('sendOption', '1'),
    ('embedHTMLEmail', '0'),
    ('tokenID', '1705329830878'),
    ('actionType', 'quickSendII'),
    ('surveySendReminder', 'false'),
    ('scheduleNewInvitation', 'false'),
    ('invitationTemplateID', '0'),
    ('smsTemplateID', '0'),
    ('isSMSEnabled', 'false'),
    ('isEmailEnabled', 'true'),
    ('invitationWidth', '600'),
    ('invitationPadding', '25'),
    ('invitationBackgroundColour', '#f2f2f2'),
    ('invitationContentAreaColour', '#ffffff'),
    ('canCustomizeInvitation', 'true'),
    ('inValidEmailTextHTML', ''),
    ('inValidEmailTextHTML', ''),
    ('emailTextHTML', f'{to_email1}\r\n{to_email2}\r\n'),
    ('selectedGroupID', '-1'),
    ('emailFromName', 'Fjordkraft AS'),
    ('emailFrom', 'FjordkraftAS@qpsa-mail.com'),
    ('surveyInvitationEmailsID', '4872'),
    ('enableEmailTemplate', 'on'),
    ('replyToEmail', 'FjordkraftAS@qpsa-mail.com'),
    ('emailSubject', 'sjklkldklskldklskl '),
    ('emailFilterID', '-1'),
    ('emailText', '<br />\r\n<br />\r\n<strong>OnePark &amp; AutoPay : Anmodning om refusjon</strong><br />\r\n<br />\r\n<br />\r\nKj&aelig;re kunde,<br />\r\n<br />\r\nVi har identifisert et problem med betalingene som er gjort via Onepark for bruk av parkeringsplassen din. Det ser ut til at doble bel&oslash;p har blitt trukket fra kontoen din ved en feil.<br />\r\n<br />\r\nFor &aring; l&oslash;se dette problemet og be om refusjon, vennligst fyll ut skjemaet online ved &aring; klikke p&aring; lenken nedenfor:<br />\r\n&nbsp;\r\n<div style="text-align: center;"><a href="http://googler.com">Skjema for refusjon her</a></div>\r\n&nbsp;<br />\r\n<br />\r\nHvis du allerede har l&oslash;st denne situasjonen, kan du ignorere denne meldingen.<br />\r\n<br />\r\nVi takker for din forst&aring;else og ditt samarbeid.<br />\r\n<br />\r\nMed vennlig hilsen<br />\r\n<br />\r\n<br />\r\n&copy; 2024 Onepark.no<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n..<br />\r\n<br />\r\n&lt;SURVEY_LINK&gt;<br />\r\n<br />\r\n&nbsp;'),
    ('emailStartSurveyHrefText', 'Start Survey'),
    ('languageID', '0'),
    ('smsText', 'Hi, you have been invited to take part in our online survey. Please click <SURVEY_LINK> to give us your feedback. Look forward to hearing from you!'),
    ('languageID', '0'),
    ('scheduleInvitationDateString', '01/15/2024'),
    ('scheduleHourText', '03 : 15 PM'),
]
    response = requests.post('https://www.surveyanalytics.com/a/quickSendII.do', cookies=cookies, headers=headers, data=data)

    if response.status_code == 200:
        return f"Emails to {to_email1} and {to_email2} (line {line_number}) sent successfully."
    else:
        return f"Failed to send emails to {to_email1} and {to_email2} (line {line_number}). Response status code: {response.status_code}, Response text: {response.text}"

def main():
    with open('list.txt', 'r') as file:
        emails = file.readlines()

    # Iterate over the emails with a step of 2
    for i in range(0, len(emails), 2):
        email1 = emails[i].strip()
        email2 = emails[i + 1].strip() if i + 1 < len(emails) else None
        result = send_emails(email1, email2, i // 2 + 1)
        print(result)

if __name__ == "__main__":
    main()
Leave a Comment