Hmm,
Because you have national characters in domain name, then smtp adress must use punnycode:
DECLARE INTEGER IdnToAscii IN Normaliz.dll INTEGER, STRING @, INTEGER, STRING @, INTEGER
lcsource=STRCONV("test@tööd.com", 5)
lcDST=REPLICATE(CHR(0), 50)
lii=IdnToAscii(4, @lcsource, LEN(lcsource)/2, @lcDST, LEN(lcDST))
?STRCONV(LEFT(lcDST, m.lii*2),6)
MartinaJ
>Hi,
>
>Yes. Receiver domain name contains öö charaters:
>
>
https://xn--pvckatusetd-0fba.ee/>
>How to pass this as receiver domain name from FoxPro application to send e-mail?
>I expected that CDO encodes receiver e--mail properly if it is passed in UTF-8 but it looks like this does not happen.
>
>Posted also in
>
https://stackoverflow.com/questions/68672775/how-to-send-e-mail-if-receiver-domain-name-contains-unicode-characters>
>Andrus.
>
>>
>>Hmm, you need UTF-8 in smtp address (xnxaxmxex)?
>>Not it's the same such as UTF-8 in body or HTML body.
>>
>>
>>MartinaJ
>>
>>
>>>For cyrillic message body I "resolved" the issue by using latin characters instead of russian ones.
>>>
>>>Some receiver e-mail addresses contain unicode characters like
>>>
>>>test@tööd.com
>>>
>>>Trying to use CDO2000 to send to those addresses throws error
>>>
>>>ERROR: :1429 # send # 213 # 0x0000020F The server rejected one or more recipient addresses. The server response was: 501 5.1.3 Bad recipient address syntax
>>>
>>>I tried
>>>
>>>
EXTERNAL PROCEDURE cdo2000.prg
>>>loMail = NEWOBJECT("Cdo2000", "Cdo2000.fxp")
>>>WITH loMail
>>> SYS(3101 ,65001)
>>> .cTo = strconv(cRecipients,9, 1257, 1 )
>>>...
>>>
>>>
>>>But bad recipient address error still occurss. I also tried
>>>
>>> .cCharset = 'UTF-8'
>>>
>>>and in cdo2000.prg added comprop
>>>
>>> WITH This
>>> .ClearErrors()
>>> .oCfg = CREATEOBJECT("CDO.Configuration")
>>>// Added
>>> COMPROP(.oCfg, "UTF8",1)
>>> .oMsg = CREATEOBJECT("CDO.Message")
>>>// Added
>>> COMPROP(.oMsg, "UTF8",1)
>>> .oMsg.Configuration = This.oCfg
>>> ENDWITH
>>>
>>>but problem persists.
>>>I also tried blat.dll to send email this this also throws error.
>>>
>>>How to send e-mail to address test@tööd.com from FoxPro ?
>>>
>>>Mozilla Thunderbird send e-mail to this address without issues.