FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Sending mail more than one recepient with TMail
Posts: 1387
Joined: Fri May 23, 2008 01:33 PM
Sending mail more than one recepient with TMail
Posted: Wed Oct 24, 2018 10:51 AM
Hi,

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

Code (fw): Select all Collapse
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 (fw): Select all Collapse
TO      "abc@abc.com.tr","ddd@abc.com.tr"


But it does not work.

Can you help me?
Regards,



Hakan ONEMLI



Harbour & MSVC 2022 & FWH 23.06
Posts: 1515
Joined: Thu Oct 30, 2008 02:37 PM
Re: Sending mail more than one recepient with TMail
Posted: Wed Oct 24, 2018 10:56 AM
Try so:
Code (fw): Select all Collapse
TO      "abc@abc.com.tr;ddd@abc.com.tr"
Posts: 1387
Joined: Fri May 23, 2008 01:33 PM
Re: Sending mail more than one recepient with TMail
Posted: Wed Oct 24, 2018 11:04 AM
hmpaquito wrote:Try so:
Code (fw): Select all Collapse
TO      "abc@abc.com.tr;ddd@abc.com.tr"


Tried.

it gives an error code MAPI_E_UNKNOWN_RECIPIENT

Thanks,
Regards,



Hakan ONEMLI



Harbour & MSVC 2022 & FWH 23.06
Posts: 1515
Joined: Thu Oct 30, 2008 02:37 PM
Re: Sending mail more than one recepient with TMail
Posted: Wed Oct 24, 2018 11:49 AM
Now, try so:

Code (fw): Select all Collapse
TO      "abc@abc.com.tr,ddd@abc.com.tr"
Posts: 1387
Joined: Fri May 23, 2008 01:33 PM
Re: Sending mail more than one recepient with TMail
Posted: Wed Oct 24, 2018 12:21 PM
hmpaquito wrote:Now, try so:

Code (fw): Select all Collapse
TO      "abc@abc.com.tr,ddd@abc.com.tr"


same error.
Regards,



Hakan ONEMLI



Harbour & MSVC 2022 & FWH 23.06
Posts: 1515
Joined: Thu Oct 30, 2008 02:37 PM
Re: Sending mail more than one recepient with TMail
Posted: Wed Oct 24, 2018 01:26 PM
Newly, try so:

Code (fw): Select all Collapse
TO      "John Newman <abc@abc.com.tr>","Paul Six <ddd@abc.com.tr>"
Posts: 1387
Joined: Fri May 23, 2008 01:33 PM
Re: Sending mail more than one recepient with TMail
Posted: Wed Oct 24, 2018 02:34 PM
hmpaquito wrote:Newly, try so:

Code (fw): Select all Collapse
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.
Regards,



Hakan ONEMLI



Harbour & MSVC 2022 & FWH 23.06
Posts: 137
Joined: Mon Oct 22, 2012 04:43 PM
Re: Sending mail more than one recepient with TMail
Posted: Wed Oct 24, 2018 02:43 PM
Code (fw): Select all Collapse
#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
Regards



Ing. Anton Lerchster

Continue the discussion