Hi,
I was hoping someone can give me an example of sending an email with an attachment using a curl command to call the REST Api.
I have been searching without much luck, but have been able to put together the below code from example I found, but it doesn't include an attachment.
curl -s -k -X POST "$SAS_SERVICES_URL/mail/messages" -H "Authorization: Bearer $SAS_CLIENT_TOKEN" -H 'Content-Type: application/vnd.sas.mail+json' -d '{"to": [{"address": "test@test"}],"from":{"address": "user@test"},"subject": "test email","textMessage": "test body"}
Is there a way to have a different "from" address other than your own, I have tried adding a different address but get the error :
{"version":2,"httpStatusCode":400,"errorCode":11106,"message":"Invalid 'from' email address. ","details":["path: /mail/messages"],"remediation":"The 'from' email address did not match your email address."}
Any link to some documentation on this API will also be very helpful.
Thank you in advance.