FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Email multiple recipients.
Posts: 233
Joined: Sat Dec 30, 2006 06:10 AM
Email multiple recipients.
Posted: Tue May 01, 2007 07:14 PM
cTo:="ollie@theoasis.co.za; support@theoasis.co.za;"
DEFINE MAIL oMail SUBJECT cSubject ;
             TEXT cBody ;
             TO cTo ;
             FROM USER   
ACTIVATE MAIL oMail


This doesn't allow me to send to multiple recipients. How can I do it?
Many thanks

Ollie.



Using:

xHarbour Compiler build 1.2.1 (SimpLex) (Rev. 6406)

Borland C++ 5.5.1

FWH 9.04 (2009 Apr)
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Email multiple recipients.
Posted: Sun May 06, 2007 08:11 AM

Try,

cTo:="ollie@theoasis.co.za, support@theoasis.co.za"

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 233
Joined: Sat Dec 30, 2006 06:10 AM
Email multiple recipients.
Posted: Thu May 24, 2007 09:59 AM

Nope.

It puts:

ollie@theoasis.co.za, support@theoasis.co.za

in the email address, but outlook does not recognise it - it thinks its one address.

Many thanks

Ollie.



Using:

xHarbour Compiler build 1.2.1 (SimpLex) (Rev. 6406)

Borland C++ 5.5.1

FWH 9.04 (2009 Apr)
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Email multiple recipients.
Posted: Thu May 24, 2007 04:05 PM

Ollie,

Try it without the comma.

James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 233
Joined: Sat Dec 30, 2006 06:10 AM
Email multiple recipients.
Posted: Thu May 24, 2007 04:12 PM

nope.

But I overcame it by using an array: {"bill@ms.com","help@ms.com"}

Thanks for the guidance.

Many thanks

Ollie.



Using:

xHarbour Compiler build 1.2.1 (SimpLex) (Rev. 6406)

Borland C++ 5.5.1

FWH 9.04 (2009 Apr)
Posts: 233
Joined: Sat Dec 30, 2006 06:10 AM
Email multiple recipients.
Posted: Thu May 24, 2007 06:10 PM
Actually, it didn't work. I used:

oMail:aRecipients := {"ollie@theoasis.co.za","support@theoasis.co.za"}

And it lets me click Send in Outlook (lFromUser = .T.)

but it immediatley reports this message in my Inbox:


Undeliverable:
Your message did not reach some or all of the intended recipients.

Subject: SendEmail Test
Sent: 2007/05/24 20:09

The following recipient(s) could not be reached:

'ollie@theoasis.co.za' on 2007/05/24 20:09
None of your e-mail accounts could send to this recipient.

'support@theoasis.co.za' on 2007/05/24 20:09
None of your e-mail accounts could send to this recipient.


so I'm back where I started - please help.
Many thanks

Ollie.



Using:

xHarbour Compiler build 1.2.1 (SimpLex) (Rev. 6406)

Borland C++ 5.5.1

FWH 9.04 (2009 Apr)
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Email multiple recipients.
Posted: Thu May 24, 2007 07:00 PM
Ollie,

There seems to be a bug in the MAPI mail.ch include file (ver 7.05 anyway) with the TO clause preprocessing. Instead try it this way. The first address shows up in the TO field and the rest in the CC field.

Note that you need to have a window defined for MAPI to work. Note also that each recipient's address must be in it's own array.

James

// Purpose: test multiple recipients

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

function main()
   local oWnd
   define window oWnd
   activate window oWnd on init mailit()
return nil

function mailit()
   local oMail

        define mail oMail ;
           ;//to "jbott@compuserve.com","john@hotmail.com","sharon@hotmail.com" ;
           subject "Test Message";
           from user

        oMail:aRecipients:={{"jbott@compuserve.com"},{"john@hotmail.com"},{"sharon@hotmail.com"}}

         activate mail oMail
return nil
FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 233
Joined: Sat Dec 30, 2006 06:10 AM
Email multiple recipients.
Posted: Thu May 24, 2007 07:27 PM

Excellent - Thanks.

Many thanks

Ollie.



Using:

xHarbour Compiler build 1.2.1 (SimpLex) (Rev. 6406)

Borland C++ 5.5.1

FWH 9.04 (2009 Apr)

Continue the discussion