Hello all,
Just so you know I presently use West Wind Client Tools 7.23. I'll upgrade in the coming days but for what I want to do right now I don't think it's urgent to upgrade, unless you tell me it's the case.
Ok so now with my problem. I can send email with the following code
loProxy = CREATEOBJECT("wwJsonServiceClient")
lcJson = loProxy.CallService("https://api.smtp2go.com/v3/email/send",lcJson,"POST")
loProxy = null
If there was an error, for example bad connection, I'll know by looking at the cResultCode in loHTTP. So when there is an error afterwards I want to send that same email again hoping that it will be correctly sent that time.
I did the following in order to simulate sending another email to the same person. Why this code doesn't send two emails to the same person?
loProxy = CREATEOBJECT("wwJsonServiceClient")
lcJson = loProxy.CallService("https://api.smtp2go.com/v3/email/send",lcJson,"POST")
loProxy = null
loProxy2 = CREATEOBJECT("wwJsonServiceClient")
lcJson = loProxy2.CallService("https://api.smtp2go.com/v3/email/send",lcJson,"POST")
loProxy2 = null
Only one email is sent.
but this works
lcJson = ;
'{"api_key":"api-74033xxxxxxxxxxxxxxxxxxxxxxxxxxx",'
lcJson = lcJson + ;
'"to":["À moi <info@gestion-beaute.com>"],'
lcJson = lcJson + ;
'"sender":"#1 Message envoyé par TeslMLM <testmlm@gestion-beaute.com>",'
lcJson = lcJson + ;
'"subject":"Hello Test",'
lcJson = lcJson + ;
'"text_body":"Contenu avec fin ou sans"'
lcJson = lcJson + ;
"}"
loProxy = CREATEOBJECT("wwJsonServiceClient")
lcJson = loProxy.CallService("https://api.smtp2go.com/v3/email/send",lcJson,"POST")
loProxy = null
lcJson2 = ;
'{"api_key":"api-74033xxxxxxxxxxxxxxxxxxxxxxxxxxx",'
lcJson2 = lcJson2 + ;
'"to":["À moi <info@gestion-beaute.com>"],'
lcJson2 = lcJson2 + ;
'"sender":"#1 Message envoyé par TeslMLM <testmlm@gestion-beaute.com>",'
lcJson2 = lcJson2 + ;
'"subject":"Hello Test",'
lcJson2 = lcJson2 + ;
'"text_body":"Contenu avec fin ou sans"'
lcJson2 = lcJson2 + ;
"}"
loProxy = CREATEOBJECT("wwJsonServiceClient")
lcJson = loProxy.CallService("https://api.smtp2go.com/v3/email/send",lcJson2,"POST")
loProxy = null
The only difference is that one is sent with lcjson and the other lcjson2. What do I have to understand here?
Thanks
![](https://weblog.west-wind.com/images/Sponsors/Websurge-Display.png)