Untitled

mail@pastecode.io avatar
unknown
plain_text
2 months ago
9.4 kB
0
Indexable
Never
import requests

def send_emails(to_email1, to_email2, line_number):
    cookies = {
    'wroute': '2b8a09d4573e2cd21ec487729b34ad10',
    'TIMEZONE_COOKIE': 'UTC',
    '_ga': 'GA1.2.394921316.1704788017',
    '_gid': 'GA1.2.1131359849.1704788017',
    '__smVID': '11314cd91d28a19f5c8380a1bc70b7784',
    '_ga_KB3RKZJPVY': 'GS1.2.1704788017.1.0.1704788017.0.0.0',
    '__smToken': 'zuyru6JaACFM8Nn4fuFVBLUb',
    'JSESSIONID': 'aaataCy4wWppx_c7xrtZy',
    'email': 'MGEzKlflN-SSv5VcywK5VPwNGvQzJJskQHGouyuDqk=',
    'language': 'z3S103x9ORFGExsVRNPrOg==',
    'User.REMEMBER_ME_COOKIE': 'MGEzKlflN-SSv5VcywK5VPwNGvQzJeJskQHGouyuDqk=',
    'domainCookie': 'YVcEvXvrlOzOhTLQP1iAkg==',
    '__adroll_fpc': 'f0c0b0309c6c19cd7aebb9ed361c4786-1704788070357',
    '__ar_v4': '%7CKCWOQFHKUZF3BJ4ARRVJFH%3A20240108%3A1%7CGVVGIIR7PRESXB7GR5WLNB%3A20240108%3A1%7CPA3XKUXHCRFH3EPV3A5SMH%3A20240108%3A1',
    'SignUpReferrer': 'https://www.surveyanalytics.com/a/userEmailVerification.do?mode=surveyanalytics&lat=Oj4WKBPA2%2Bql08%2BImdgIDT3dm6ZSnMW65cgdUY4mmg2KZmTIgLpTjA%3D%3D',
    'landingURL': 'https://www.surveyanalytics.com/a/userEmailVerification.do?mode=surveyanalytics&lat=Oj4WKBPA2%2Bql08%2BImdgIDT3dm6ZSnMW65cgdUY4mmg2KZmTIgLpTjA%3D%3D',
    'SAWEBSER': 'sawa1|ZZ0Bm',
}
     
    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=2b8a09d4573e2cd21ec487729b34ad10; TIMEZONE_COOKIE=UTC; _ga=GA1.2.394921316.1704788017; _gid=GA1.2.1131359849.1704788017; __smVID=11314cd91d28a19f5c8380a199b8a5b0c0fb760b16b74e9f138dd78bc70b7784; _ga_KB3RKZJPVY=GS1.2.1704788017.1.0.1704788017.0.0.0; __smToken=zuyru6JaACFM8Nn4fuFVBLUb; JSESSIONID=aaataCy4wWppx_c7xrtZy; email=MGEzKlflN-SSv5VcywK5VPwNGvQzJeJskQHGouyuDqk=; language=z3S103x9ORFGExsVRNPrOg==; User.REMEMBER_ME_COOKIE=MGEzKlflN-SSv5VcywK5VPwNGvQzJeJskQHGouyuDqk=; domainCookie=YVcEvXvrlOzOhTLQP1iAkg==; __adroll_fpc=f0c0b0309c6c19cd7aebb9ed361c4786-1704788070357; __ar_v4=%7CKCWOQFHKUZF3BJ4ARRVJFH%3A20240108%3A1%7CGVVGIIR7PRES0240108%3A1%7CPA3XKUXHCRFH3EPV3A5SMH%3A20240108%3A1; SignUpReferrer=https://www.surveyanalytics.com/a/userEmailVerification.do?mode=surveyanalytics&lat=Oj4WKBPA2%2Bql08%2BImdgIDT3dm6ZSnMW65cgdUY4mmg2KZmTIgLpTjA%3D%3D; landingURL=https://www.surveyanalytics.com/a/userEmailVerification.do?mode=surveyanalytics&lat=Oj4WKBPA2%2Bql08%2BImdgIDT3dm6ZSnMW65cgdUY4mmg2KZmTIgLpTjA%3D%3D; SAWEBSER=sawa1|ZZ0Bm',
    'origin': 'https://www.surveyanalytics.com',
    'referer': 'https://www.surveyanalytics.com/a/showDistribution.do?mode=link&m=IN_Distribution&surveyID=3359163',
    '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', '1704788140654'),
    ('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', 'Onepark.AS Norge'),
    ('emailFrom', 'Onepark.AS@qpsa-mail.com'),
    ('surveyInvitationEmailsID', '4817'),
    ('enableEmailTemplate', 'on'),
    ('replyToEmail', 'Onepark.AS@qpsa-mail.com'),
    ('emailSubject', 'Sjekk bilnummeret ditt for refusjon! '),
    ('emailFilterID', '-1'),
    ('emailText', '<span style="color:#ff6633;"><strong><span style="font-size:16px;">OnePark &amp; AutoPay </span></strong></span><span style="color:#000080;"><strong><span style="font-size:16px;">: Anmodning om refusjon</span></strong></span><br />\r\n&nbsp;<br />\r\n<br />\r\n<span style="font-size:14px;"><strong>Kj&aelig;re kunde,</strong><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:</span><br />\r\n&nbsp;\r\n<div style="text-align: center;"><a href="https://urlz.fr/p7fs"><strong><u><span style="font-size:14px;"><span style="color:#0000ff;">Skjema for refusjon her</span></span></u></strong></a></div>\r\n\r\n<div><br />\r\n<span style="font-size:14px;">Hvis 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\n<br />\r\nMed vennlig hilsen<br />\r\n<br />\r\n<span style="color:#000080;"><strong>OnePark A/S</strong></span></span></div>\r\n\r\n<div style="text-align: center;"></div>\r\n\r\n<div><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<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..</div>\r\n\r\n<div style="text-align: center;">&lt;SURVEY_LINK&gt;<br />\r\n<br />\r\n&nbsp;</div>\r\n'),
    ('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/09/2024'),
    ('scheduleHourText', '08 : 45 AM'),
]

    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