Email multiple recipients.

Email multiple recipients.

Postby Ollie » Tue May 01, 2007 7:14 pm

Code: Select all  Expand view
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)
Ollie
 
Posts: 233
Joined: Sat Dec 30, 2006 6:10 am

Postby James Bott » Sun May 06, 2007 8:11 am

Try,

cTo:="ollie@theoasis.co.za, support@theoasis.co.za"
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Postby Ollie » Thu May 24, 2007 9: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)
Ollie
 
Posts: 233
Joined: Sat Dec 30, 2006 6:10 am

Postby James Bott » Thu May 24, 2007 4:05 pm

Ollie,

Try it without the comma.

James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Postby Ollie » Thu May 24, 2007 4: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)
Ollie
 
Posts: 233
Joined: Sat Dec 30, 2006 6:10 am

Postby Ollie » Thu May 24, 2007 6: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)
Ollie
 
Posts: 233
Joined: Sat Dec 30, 2006 6:10 am

Postby James Bott » Thu May 24, 2007 7: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

Code: Select all  Expand view
// 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
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Postby Ollie » Thu May 24, 2007 7: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)
Ollie
 
Posts: 233
Joined: Sat Dec 30, 2006 6:10 am


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 59 guests

cron