Outlook Rest API not listening to my command of sending an email with a specific email address

53 Views Asked by At
import pandas as pd
import win32com.client as win32
import re

# Set up the Outlook application
outlook = win32.Dispatch('outlook.application')


# set the email account to send emails
for account in accounts:
    if account.SmtpAddress == "[email protected]":
        send_account = account
        break

I'm trying to create a mass emailing program that sends emails to our users. I'm having the issue of the REST Outlook API not using the correct email address to send these emails. I tried specifying it use [email protected] as seen in the code but it keeps using the default email. I also tried making the email I want to use the default email but to no avail. The email I am trying to use to send emails is not an outlook or exchange email so it is setup in the OUTLOOK app through smtp. I'm relatively new to coding and I've been beating myself up with this for hours. this is a small snippet as stack overflow swears my 82 lines of code is spam. All help is VERY APPRECIATED!

0

There are 0 best solutions below