PC SOFT

FOROS PROFESIONALES
WINDEVWEBDEV y WINDEV Mobile

Inicio → WEBDEV 2024 → Convert ANSI string to array
Convert ANSI string to array
Iniciado por marin, 27,ene. 2021 12:29 - 4 respuestas
Miembro registrado
27 mensajes
Publicado el 27,enero 2021 - 12:29
Hi, I am newby in Webdev and general begginer in programing at all.

Trying to send mail, I configured SMTP for sending mail, put Edit box for data input and here is my code.
I am getting error in "Suggestion..Recipient = EDT_Receive_to" line in EMAIL PREPARATION part, it can not convert ANSI string to array.
Tried StringToArray, but it does not work, and also tried to extract string but no success. Does anyone have suggestion?




Miembro registrado
27 mensajes
Publicado el 27,enero 2021 - 14:38
I've used a WordToArray function to pass string from Edit control for recipient and it seams that it is no error anymore there, but still can't send the message. Suspect that is problem in SMTP configuration. Any thoughts? Thanks in advance.




Publicado el 27,enero 2021 - 16:36
as you are a beginner, I'm going to give you a step by step method...

First read the error message (and give us the FULL error message)... Here it says
"it can not convert ANSI string to array"

And this is happening on the line "Suggestion..Recipient = EDT_Receive_to"
So clearly, this means that EDT_Receive_to is an ansi string, and that Suggestion..Recipient IS AN ARRAY... which makes total sense, as you can always send an email to MULTIPLE recipient

Now, if Suggestion..Recipient is an array, you need to set your value in ONE LINE of the array, and the syntax is therefore here:

Suggestion..Recipient[1] = EDT_Receive_to

And OF COURSE, you also need to set the NUMBER of recipients before that with something likle
Suggestion..NBRecipient = 1

Now a last advise for the beginner: READ THE HELP.... The whole solution of your problem is clearly visible in the EXAMPLES shown on the help page of the email functions...
Miembro registrado
27 mensajes
Publicado el 09,febrero 2021 - 08:58
Thank you for the answer. I found the example which consist the solution of the problem. I should read help a bit better.
Publicado el 30,mayo 2021 - 11:14
Hi specify how many recepients there are.

FOR EACH STRING sDest OF sRecipientList SÉPARÉE BY “;”
Email.NbRecipient++
Email.Recipient[Email.NbRecipient] = sDest
END



If there is oly one add [1]