Sending mail more than one recepient with TMail

Post Reply
Horizon
Posts: 997
Joined: Fri May 23, 2008 1:33 pm

Sending mail more than one recepient with TMail

Post 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?
Regards,

Hakan ONEMLI

Harbour & VS 2019 & FWH 20.12
hmpaquito
Posts: 1200
Joined: Thu Oct 30, 2008 2:37 pm

Re: Sending mail more than one recepient with TMail

Post by hmpaquito »

Try so:

Code: Select all

TO      "abc@abc.com.tr;ddd@abc.com.tr"
Horizon
Posts: 997
Joined: Fri May 23, 2008 1:33 pm

Re: Sending mail more than one recepient with TMail

Post 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,
Regards,

Hakan ONEMLI

Harbour & VS 2019 & FWH 20.12
hmpaquito
Posts: 1200
Joined: Thu Oct 30, 2008 2:37 pm

Re: Sending mail more than one recepient with TMail

Post by hmpaquito »

Now, try so:

Code: Select all

TO      "abc@abc.com.tr,ddd@abc.com.tr"
Horizon
Posts: 997
Joined: Fri May 23, 2008 1:33 pm

Re: Sending mail more than one recepient with TMail

Post by Horizon »

hmpaquito wrote:Now, try so:

Code: Select all

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

Hakan ONEMLI

Harbour & VS 2019 & FWH 20.12
hmpaquito
Posts: 1200
Joined: Thu Oct 30, 2008 2:37 pm

Re: Sending mail more than one recepient with TMail

Post by hmpaquito »

Newly, try so:

Code: Select all

TO      "John Newman <abc@abc.com.tr>","Paul Six <ddd@abc.com.tr>"
Horizon
Posts: 997
Joined: Fri May 23, 2008 1:33 pm

Re: Sending mail more than one recepient with TMail

Post 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.
Regards,

Hakan ONEMLI

Harbour & VS 2019 & FWH 20.12
User avatar
alerchster
Posts: 31
Joined: Mon Oct 22, 2012 4:43 pm

Re: Sending mail more than one recepient with TMail

Post 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
 
Regards

Ing. Anton Lerchster
Post Reply