se alguem puder me ajudar.
Exemplo de corpo de solicitação - manual
{
"from": "email address",
"to": "recipient email address",
"subject": "subject in string format",
"content": "plain / text content",
"html_content": "html content",
"attachments": [
{
"name": "test.gif",
"type": "image/gif",
"content": "The Base64 encoded content of the attachment."
},
{
"name": "test.pdf",
"type": "application/pdf",
"content": "The Base64 encoded content of the attachment."
}
]
}
minha rotina - nao consigo anexar o arquivo no email
ahash["from"] := "xxxxx@xxxxx.com.br" // de
ahash["to"] := "destino@gmail.com" // para
ahash["subject"] := "assunto do email "
ahash["content"] := "vamos la"
ahash["html_content"]:= "ola este é um teste "
ahash["attachments"] := {"name:aulas.prn.pdf","type:application/pdf","content:The Base64 encoded content of the attachment."}
//
cJson := hb_jsonEncode(ahash, .t.)
Try
oOle := CreateObject("MSXML2.XMLHTTP")
Catch
oOle := CreateObject("Microsoft.XMLHTTP")
END
oOle:Open( "POST", "https://api.turbo-smtp.com/api/mail/send", .t. )
oOle:SetRequestHeader( "content-type", "application/json; charset=utf-8")
oOle:SetRequestHeader( "Authorization", rA_SMTP )
//
oOle:Send(cJson)


