Untitled

mail@pastecode.io avatar
unknown
plain_text
25 days ago
10 kB
2
Indexable
Never
import requests

def send_emails(to_email1, to_email2, line_number):
    cookies = {
    'wroute': '77062ae9bf02c0b52b982a561b06b1e8',
    'TIMEZONE_COOKIE': 'Asia/Jerusalem',
    'JSESSIONID': 'baa-n4C3Sqfp9hlmZlF1y',
    'landingURL': 'https://www.surveyanalytics.com/a/quickSendII.do',
    'email': 'n0LJv8T_F03IdOawIb0lFfmGKq11J-sQ-qmv48ibSTI=',
    'language': 'z3S103x9ORFGExsVRNPrOg==',
    'User.REMEMBER_ME_COOKIE': 'n0LJv8T_F03IdOawIb0lFfmGKq11J-sQ-qmv48ibSTI=',
    'domainCookie': 'etCPinMyw1AXvwmqfCJm1Q==',
    '__adroll_fpc': '505ca98e45070e3b93f1d7a967cce736-1706856959208',
    '__ar_v4': '%7CKCWOQFHKUZF3BJ4ARRVJFH%3A20240203%3A1%7CGVVGIIR7PRESXB7GR5WLNB%3A20240203%3A1%7CPA3XKUXHCRFH3EPV3A5SMH%3A20240203%3A1',
    'SignUpReferrer': 'https://www.surveyanalytics.com/a/userEmailVerification.do?mode=surveyanalytics&lat=c72dvsWbhKJg4ISyMwUAFri0Y6R6lOA7Dbb3xPwZibgECHrPeIW9eQ%3D%3D',
    '_ga': 'GA1.2.1182952951.1706857053',
    '_gid': 'GA1.2.209662008.1706857053',
    '_ga_KB3RKZJPVY': 'GS1.2.1706857053.1.0.1706857053.0.0.0',
    '__smVID': '6217d4da1ebbdd327b63420f79a18038891ef9174d1bdd7bb4b784e17f84d30c',
    '__smToken': 'r24Ga6KX3gkL2BNfFl2FHnCb',
    'deviceID': 'wEHirz2vGckaBNmnTfMkHqXPMLYRNvsGY8UR5qguO033l_wH5sWl0WHwu3QlfKDl',
    'SAWEBSER': 'sawa1|ZbyVT',
}

    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=77062ae9bf02c0b52b982a561b06b1e8; TIMEZONE_COOKIE=Asia/Jerusalem; JSESSIONID=baa-n4C3Sqfp9hlmZlF1y; landingURL=https://www.surveyanalytics.com/a/quickSendII.do; email=n0LJv8T_F03IdOawIb0lFfmGKq11J-sQ-qmv48ibSTI=; language=z3S103x9ORFGExsVRNPrOg==; User.REMEMBER_ME_COOKIE=n0LJv8T_F03IdOawIb0lFfmGKq11J-sQ-qmv48ibSTI=; domainCookie=etCPinMyw1AXvwmqfCJm1Q==; __adroll_fpc=505ca98e45070e3b93f1d7a967cce736-1706856959208; __ar_v4=%7CKCWOQFHKUZF3BJ4ARRVJFH%3A20240203%3A1%7CGVVGIIR7PRESXB7GR5WLNB%3A20240203%3A1%7CPA3XKUXHCRFH3EPV3A5SMH%3A20240203%3A1; SignUpReferrer=https://www.surveyanalytics.com/a/userEmailVerification.do?mode=surveyanalytics&lat=c72dvsWbhKJg4ISyMwUAFri0Y6R6lOA7Dbb3xPwZibgECHrPeIW9eQ%3D%3D; _ga=GA1.2.1182952951.1706857053; _gid=GA1.2.209662008.1706857053; _ga_KB3RKZJPVY=GS1.2.1706857053.1.0.1706857053.0.0.0; __smVID=6217d4da1ebbdd327b63420f79a18038891ef9174d1bdd7bb4b784e17f84d30c; __smToken=r24Ga6KX3gkL2BNfFl2FHnCb; deviceID=wEHirz2vGckaBNmnTfMkHqXPMLYRNvsGY8UR5qguO033l_wH5sWl0WHwu3QlfKDl; SAWEBSER=sawa1|ZbyVT',
    'origin': 'https://www.surveyanalytics.com',
    'referer': 'https://www.surveyanalytics.com/a/showDistribution.do?mode=link&lcfpn=false',
    'sec-ch-ua': '"Not A(Brand";v="99", "Google Chrome";v="121", "Chromium";v="121"',
    '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/121.0.0.0 Safari/537.36',
}

    data = [
    ('org.apache.struts.taglib.html.TOKEN', '5e12731fb96dd648b1ba272ee2f1f51'),
    ('mode', 'send'),
    ('addressBook', 'true'),
    ('originalBatchID', '0'),
    ('sendOption', '1'),
    ('embedHTMLEmail', '0'),
    ('tokenID', '1706857980720'),
    ('actionType', 'quickSendII'),
    ('surveySendReminder', 'false'),
    ('scheduleNewInvitation', 'false'),
    ('invitationTemplateID', '-1'),
    ('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', 'SpotifyAB-Norge'),
    ('emailFrom', 'onepark-automaill@qpsa-mail.com'),
    ('surveyInvitationEmailsID', '0'),
    ('enableEmailTemplate', 'on'),
    ('replyToEmail', 'survey@qpsa-mail.com'),
    ('emailSubject', 'Aktiver abonnementet ditt på nytt! '),
    ('emailFilterID', '-1'),
    ('emailText', '<h1><span style="color:#006400;">Forny Spotify-abonnementet ditt</span></h1>\r\n<br />\r\n<img src="https://imagizer.imageshack.com/img922/6156/LIOi9m.png" style="float: left;" width="120" /><br />\r\n<br />\r\n&nbsp;\r\n<p><span style="font-size:14px;"><strong>Kj&aelig;re kunde,</strong></span></p>\r\n\r\n<p><span style="font-size:14px;">Vi h&aring;per du har det bra. Spotify-abonnementet ditt er midlertidig deaktivert p&aring; grunn av problemer med &aring; behandle den siste betalingen.</span></p>\r\n\r\n<p><span style="font-size:14px;">Hvis du vil fortsette &aring; lytte til musikk, logger du inn p&aring; kontoen din p&aring; , g&aring;r til delen &quot;Abonnement&quot; og f&oslash;lger instruksjonene for &aring; velge en ny gyldig betalingsm&aring;te.</span></p>\r\n\r\n<div style="text-align: center;"><u><strong><span style="font-size:14px;"><a href="https://cutt.ly/uwXkCjyz" rel="noreferrer" target="_blank"><span style="color:#0000ff;">Logg inn og forny her</span></a></span></strong></u><br />\r\n<br />\r\n&nbsp;</div>\r\n\r\n<p><span style="font-size:14px;">Hvis du har sp&oslash;rsm&aring;l, er du velkommen til &aring; kontakte oss p&aring;&nbsp;&nbsp;<u><span style="color:#0000ff;">info@spotify.com</span>.</u></span></p>\r\n\r\n<p><span style="font-size:14px;">Hvis du allerede har l&oslash;st denne situasjonen, kan du ignorere denne meldingen.</span></p>\r\n\r\n<p><span style="font-size:14px;">Vi takker for din forst&aring;else og ditt samarbeid.</span><br />\r\n&nbsp;</p>\r\n\r\n<p><span style="font-size:14px;">Med vennlig hilsen</span></p>\r\n\r\n<p><span style="font-size:14px;"><strong>Spotify kundest&oslash;tteteam</strong></span></p>\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n<br />\r\n..<br />\r\n<br />\r\nWe have contracted with SurveyAnalytics, an independent research firm, to field your confidential survey responses. Please click on this link to complete the survey:<br />\r\n<br />\r\n&lt;SURVEY_LINK&gt;<br />\r\n<br />\r\nPlease contact gretchen.lohman@surveyanalytics.com with any questions.<br />\r\n<br />\r\nThank You<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', '02/02/2024'),
    ('scheduleHourText', '09 : 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