When trying to send email through the VIYA REST api from a shell script I get the following message:
{"version":2,"httpStatusCode":400,"message":"The request body was missing or invalid.",
"details":["path: /mail/messages","correlator: 70862b93-1626-4763-ad6d-b7d5d6e1032e"]}
This is how I issue the request:
curl -s -k -X POST "$base_url/mail/messages" \
-H "Authorization: Bearer $IDTOKEN" \
-H 'Content-Type: application/vnd.sas.mail+json' \
-d '{
"to":"me@email.adres",
"subject":"testmail door Gerold van viya LTEST",
"message":"Deze mail wordt verstuurd met de VIYA REST API"
}'
I can't find documentation on the data part of the request. Documetation only mentions to have the three fields. I tried making the "message" field a list but that doesn't work either.
Mr. Gwooton,
how can i use this with starttls, the example is not working with starttls eventhough we have mail.smtp.starttls.enable : true in configuration.
Example error output :
{"version":2,"httpStatusCode":400,"errorCode":11104,"message":"Couldn't connect to host, port: OURSMTPSERVER, 25; timeout -1","details":["Caused by gomail: could not send email 1: 530 #5.7.0 Must issue a STARTTLS command first","path: /mail/messages","correlator: f965315d-08e9-4af1-bf19-e4227f7fda74"]}sh-4.4$
Yes we did this.
Greg,
this is what I sended to support today.
Dear Support,
eureka !
I found a workaround by accident .
I saw that we have DEBUG=true as optional parameter.
I added DEBUG=true and the pod started again.
Then today I had a brainwave.
I changed DEBUG=true in ...... mail.smtp.starttls.enable=true.
IT WORKS !!!!
Greg, exactly !
Regards.
Dik
Any idea how to send with attachments, using this same method
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!