Skip to content

Instantly share code, notes, and snippets.

@raj-arun
Last active April 5, 2021 19:57
Show Gist options
  • Save raj-arun/50ac5322e83fbedb1c4f360b4fd9ee9f to your computer and use it in GitHub Desktop.
Save raj-arun/50ac5322e83fbedb1c4f360b4fd9ee9f to your computer and use it in GitHub Desktop.
Send Email from EPM using sendmail REST API
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