Sending mail more than one recepient with TMail

Sending mail more than one recepient with TMail

Postby Horizon » 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: Select all  Expand view  RUN

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  Expand view  RUN
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.04
Horizon
 
Posts: 1322
Joined: Fri May 23, 2008 1:33 pm

Re: Sending mail more than one recepient with TMail

Postby hmpaquito » Wed Oct 24, 2018 10:56 am

Try so:
Code: Select all  Expand view  RUN
TO      "abc@abc.com.tr;ddd@abc.com.tr"
hmpaquito
 
Posts: 1482
Joined: Thu Oct 30, 2008 2:37 pm

Re: Sending mail more than one recepient with TMail

Postby Horizon » Wed Oct 24, 2018 11:04 am

hmpaquito wrote:Try so:
Code: Select all  Expand view  RUN
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.04
Horizon
 
Posts: 1322
Joined: Fri May 23, 2008 1:33 pm

Re: Sending mail more than one recepient with TMail

Postby hmpaquito » Wed Oct 24, 2018 11:49 am

Now, try so:

Code: Select all  Expand view  RUN
TO      "abc@abc.com.tr,ddd@abc.com.tr"
hmpaquito
 
Posts: 1482
Joined: Thu Oct 30, 2008 2:37 pm

Re: Sending mail more than one recepient with TMail

Postby Horizon » Wed Oct 24, 2018 12:21 pm

hmpaquito wrote:Now, try so:

Code: Select all  Expand view  RUN
TO      "abc@abc.com.tr,ddd@abc.com.tr"


same error.
Regards,

Hakan ONEMLI

Harbour & MSVC 2022 & FWH 23.04
Horizon
 
Posts: 1322
Joined: Fri May 23, 2008 1:33 pm

Re: Sending mail more than one recepient with TMail

Postby hmpaquito » Wed Oct 24, 2018 1:26 pm

Newly, try so:

Code: Select all  Expand view  RUN
TO      "John Newman <abc@abc.com.tr>","Paul Six <ddd@abc.com.tr>"
hmpaquito
 
Posts: 1482
Joined: Thu Oct 30, 2008 2:37 pm

Re: Sending mail more than one recepient with TMail

Postby Horizon » Wed Oct 24, 2018 2:34 pm

hmpaquito wrote:Newly, try so:

Code: Select all  Expand view  RUN
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.04
Horizon
 
Posts: 1322
Joined: Fri May 23, 2008 1:33 pm

Re: Sending mail more than one recepient with TMail

Postby alerchster » Wed Oct 24, 2018 2:43 pm

Code: Select all  Expand view  RUN
#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
User avatar
alerchster
 
Posts: 95
Joined: Mon Oct 22, 2012 4:43 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 64 guests