PC SOFT

FOROS PROFESIONALES
WINDEVWEBDEV y WINDEV Mobile

Inicio → WINDEV 2024 → v21 Loop through Email.Cc array email fields
v21 Loop through Email.Cc array email fields
Iniciado por tony.turner, 27,nov. 2016 09:13 - No hay respuesta
Publicado el 27,noviembre 2016 - 09:13
Hi

I import Pop3 email into a table and once imported delete the email from pop server works fantastic.

Only bit I fail to get to work is deal with the array for cc, bcc email addresses and multiple attachments as again its an array.

How do I loop cc, bcc and attachment array.

Any chance of 1 example snippet for cc array.

Thanks

Tony

// Start a POP3 session
MySession is EmailPOP3Session

MySession..ServerAddress = ""
MySession..Port = ""
MySession..Name = ""
MySession..Password = ""

EmailStartSession(MySession)

// Retrieve all the messages
arrMessage is array of Emails
arrMessage = EmailGetAll(MySession)

// Browse the array of messages by subscript
FOR i = 1 _TO_ MySession..EmailBySubscript..Occurrence


salestndwcouk.emaildate = MySession..EmailBySubscript[i]..ReceiveDate
salestndwcouk.emailfrom = MySession..EmailBySubscript[i]..SenderAddress
salestndwcouk.toemail = MySession..EmailBySubscript[i]..Recipient[1]
salestndwcouk.subject = MySession..EmailBySubscript[i]..Subject
salestndwcouk.body = MySession..EmailBySubscript[i]..PlainText
salestndwcouk.htmlbody = MySession..EmailBySubscript[i]..HTML


// how do i deal with cc, bcc array
// need to loop array Email.Cc

// struggle with attachments as an array

//if MySession..EmailBySubscript[i]..Attach[1].Content <> "" then
//salestndwcouk.attachment = MySession..EmailBySubscript[i]..Attach[1]
//end

HAdd(salestndwcouk,hWriteDefault)
EmailDeleteMessage(MySession,i)
END