Page 1 of 1

Sending mail more than one recepient with TMail

Posted: Wed Oct 24, 2018 10:51 am
by Horizon
Hi,

I try to use this function to send mail (I have to use local outlook mail)

Code: Select all

function DirectMessage()

   local oMail

   DEFINE MAIL oMail ;
      SUBJECT "FiveWin Mail-control power" ;
      TEXT    "This is real xBase power at your fingertips!" ;
      TO      "abc@abc.com.tr"

   ACTIVATE MAIL oMail

   MsgInfo( oMail:nRetCode )

return nil
This function is working good. But I have to send more than one recepient.

I have try

Code: Select all

TO      "abc@abc.com.tr","ddd@abc.com.tr"
But it does not work.

Can you help me?

Re: Sending mail more than one recepient with TMail

Posted: Wed Oct 24, 2018 10:56 am
by hmpaquito
Try so:

Code: Select all

TO      "abc@abc.com.tr;ddd@abc.com.tr"

Re: Sending mail more than one recepient with TMail

Posted: Wed Oct 24, 2018 11:04 am
by Horizon
hmpaquito wrote:Try so:

Code: Select all

TO      "abc@abc.com.tr;ddd@abc.com.tr"
Tried.

it gives an error code MAPI_E_UNKNOWN_RECIPIENT

Thanks,

Re: Sending mail more than one recepient with TMail

Posted: Wed Oct 24, 2018 11:49 am
by hmpaquito
Now, try so:

Code: Select all

TO      "abc@abc.com.tr,ddd@abc.com.tr"

Re: Sending mail more than one recepient with TMail

Posted: Wed Oct 24, 2018 12:21 pm
by Horizon
hmpaquito wrote:Now, try so:

Code: Select all

TO      "abc@abc.com.tr,ddd@abc.com.tr"
same error.

Re: Sending mail more than one recepient with TMail

Posted: Wed Oct 24, 2018 1:26 pm
by hmpaquito
Newly, try so:

Code: Select all

TO      "John Newman <abc@abc.com.tr>","Paul Six <ddd@abc.com.tr>"

Re: Sending mail more than one recepient with TMail

Posted: Wed Oct 24, 2018 2:34 pm
by Horizon
hmpaquito wrote:Newly, try so:

Code: Select all

TO      "John Newman <abc@abc.com.tr>","Paul Six <ddd@abc.com.tr>"
When I send, there is no error message. But mail can not delivered message is came from system mail admin.

It thinks name is John Newman <abc@abc.com.tr> mail adres is Paul Six <ddd@abc.com.tr>. so mail can not delivered.

Re: Sending mail more than one recepient with TMail

Posted: Wed Oct 24, 2018 2:43 pm
by alerchster

Code: Select all

#include "fivewin.ch"
#include "mail.ch"

function DirectMessage()

   local oMail
   local i
   local aTo:={}

   aadd(aTo, {"abc@abc.com.tr"})
   aadd(aTo, {"ddd@abc.com.tr"})

   DEFINE MAIL oMail ;
      SUBJECT "FiveWin Mail-control power" ;
      TEXT    "This is real xBase power at your fingertips!" 

    FOR i := 1 TO LEN( aTo )
     AADD( oMail:aRecipients, aTo[ i ] )
    NEXT i
    

   ACTIVATE MAIL oMail

   MsgInfo( oMail:nRetCode )

return nil