Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import exchangelib
- import getpass
- credentials = exchangelib.Credentials(username='domain.com\\username', password=getpass.getpass())
- config = exchangelib.Configuration(server='my.mailserver.com', credentials=credentials)
- m = exchangelib.Message(
- account=exchangelib.Account(primary_smtp_address='myemail@email.com', credentials=credentials,
- autodiscover=False, config=config, access_type=exchangelib.DELEGATE),
- subject='Test',
- body=exchangelib.HTMLBody('<html><body>Hello happy <blink>OWA user!</blink></body></html>'),
- to_recipients=[exchangelib.Mailbox(email_address='destination@email.com')]
- )
- m.send()
Add Comment
Please, Sign In to add comment