multiple recpients (touching on this again)

bpaquette

Registered User.
Local time
Today, 05:43
Joined
Aug 13, 2003
Messages
119
ok, so using the code i got from another post in this forum....


Dim EmailApp, NameSpace, EmailSend As Object

Set EmailApp = CreateObject("Outlook.Application")
Set NameSpace = EmailApp.getNameSpace("MAPI")
Set EmailSend = EmailApp.CreateItem(0)

EmailSend.to = "brandon.paquette@lnd.amedd.army.mil"
EmailSend.Subject = "MEMBER INPROCESSING"
EmailSend.Body = "The following member has inprocessed!" & " -- " & Me.txtName & Me.txtSSAN
EmailSend.Send

Set EmailApp = Nothing
Set NameSpace = Nothing
Set EmailSend = Nothing

well when i try to add additional recpients, i fail! apparently the .to function (or whatever vb calls it) limits you to 1 recipient. i'd use cc/bcc but i have 8 recpis and those also limit recipients to 1.

i can't find any documenting on the outlook.application object in the help files, so i'm at a loss, is there any other function that will let me use multiple recipients? i'd rather not set up a mailing list...
 
Dim EmailApp As Object, NameSpace As Object, EmailSend As Object



Anyway, what code do you have to accept more than one email addresss for the two.

You've hard coded the to but haven't provided an example of you trying to add a second address...a third, etc...
 
apologies.



the line that wont work is:

EmailSend.to = "braSndon.paquette@lnd.amedd.army.mil; carolySn.rodgers@lnd.amedd.army.mil;jane.Swild@lnd.amedd.army.mil"

the same format fails w/ cc/bcc
 
may be a stupid suggestion

have you tried putting a space between the addresses, when outlook confirms that it recognises the email address it normally adds a space..

it is a shot in the dark.. but might be worth a try..

John.
 
it recognises the email addresses...the SOB tells me it wont accept more than one :)
 
you could adapt this maybe...

Private Sub Command10_Click()
On Error GoTo Err_Command10_Click
Dim strTextMessage As String
strTextMessage = "DATA AS SUMMARISED ON QUALITY ASSURANCE FORM NOW AVAILABLE ON THE X DRIVE" & Chr(13)
strTextMessage = strTextMessage & "PROJECT TITLE :- " & Me!txt1a & " - " & Me!txt1d & Chr(13)

DoCmd.SendObject acSendNoObject, , , Me!NfER1, Me!txtemailaddressCC, , Me!txt1a & " - " & Me!txt1d, strTextMessage, True

/******
modify the docmd.sendobjects section above.. you should be able to enter in extra email addresses here or refer to a txtbox etc that holds the addresses..

John
 
this works great! is there ayway to actually send it? that code opens the mail w/ the text but doesn't send
 
just at the end of the docmd.sendobjects section, change the flag to false..

that stops the preview and sends it straight away..

glad it helped.

john
 

Users who are viewing this thread

Back
Top Bottom