Last active
April 5, 2021 19:57
-
-
Save raj-arun/50ac5322e83fbedb1c4f360b4fd9ee9f to your computer and use it in GitHub Desktop.
Send Email from EPM using sendmail REST API
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
url = "https://hostname/interop/rest/v1/services/sendmail" | |
payload='to=user%40example.com&subject=Email%20from%20REST%20API&body=some%20body%20test&attachments=Metadata.xlsx' | |
headers = { | |
'Authorization': 'Basic YTY2ODE5NC5BcnVuLlN1cmVuZHJhbkBiYWtlcnRpbGx5LmNvbTpWY2lfYXJjc18wMDc=', | |
'Content-Type': 'application/x-www-form-urlencoded' | |
} | |
response = requests.request("POST", url, headers=headers, data=payload) | |
print(response.text) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment