[Webinar] Streamline your web hosting managementRegister Today

x
?
Solved

Problems sending a multiple recipient outlook mail from Notes.

Posted on 1999-11-05
5
Medium Priority
?
397 Views
Last Modified: 2013-12-18
I have an action button on a form in Lotus Notes that creates an outlook mail message, assigns values from the document to the To, Subject, and Body fields and sends it.  It works fine if I give it one name to send to.  If I try to give it multiple recipients it gives the following error:

OutILib.dll: Outlook does not recognize one or more names.

The names are spelled correctly and they are valid in Outlook.  How do I tell Outlook that I want the message to go to multiple people?  I am pulling the names from a SendTo field on the current document.  Here is the code:

Sub CreateOutlookMsg (doc As NotesDocument)
     Dim Sendnames As Notesitem
     Set Sendnames = doc.GetFirstItem("SendTo")
     
 'Get an outlook application object
     Set objSession = CreateObject("Outlook.Application")
     
'Create a new message
     Set objMessage= objSession.CreateItem(olMailItem)
         
'Set the subject and message fields
     cnumber = doc.ComplaintNumber(0)
     createdby = doc.Author(0)
     
'Set the SendTo Fields on the
     recips = Sendnames.Text
     Subject$ = "New Suspected Adverse Drug Reaction report  (THIS IS A TEST)"
     Message$ = "A new report has been submitted by " & createdby & _
     " for record " & cnumber & "."
     
     Set objRecipient = objMessage.Recipients.Add (recips)
     objMessage.subject = Subject$
     objMessage.Body = Message$
     Call objMessage.Send()
End Sub


Thanks for any help you can provide!
0
Comment
Question by:Sammi110599
  • 3
  • 2
5 Comments
 

Author Comment

by:Sammi110599
ID: 2186196
Edited text of question.
0
 
LVL 9

Expert Comment

by:Arunkumar
ID: 2186229
Hi sammy !

Try the same thing manually by adding multiple recipients.  If you succeed then look into your code.

I guess item.text gives the list values separated by semicolons.  This may be a problem with Outlook.  Try replacing these semicolons with commas and send the memo.

All the best.

:)
Arun
0
 

Author Comment

by:Sammi110599
ID: 2186482
Arun,

Per your suggestion, I manually added the names to an Outlook message in the same format they are being passed in the script.  That worked but Outlook checks the names and re-formats them based on what is in the Outlook address book anyway.  I then hard-coded the 'recips' variable as a literal string with the names separated by commas. e.g. "Joe Blow, Bob Jones, Jane Doe"  This gave me the same error.  Finally I tried giving the 'recips' variable another literal string with the names formatted the way Outlook formats them.  i.e.  "Jones Bob CV USAT EXC" (our organizational stuff).  That gave me the same error.

Any other ideas?

FYI:  I did try passing item.Values to the recipients field like this:

Set Sendnames = doc.GetFirstItem("SendTo")
..
..
..
recips = Sendnames.Values
..
..
..
Set objRecipient = objMessage.Recipients.Add (recips)

This results in an error on the "Set objRecipient..." line that says "Automation object argument type mismatch".  I assume its looking for text?

Again, thanks for your help.
0
 

Author Comment

by:Sammi110599
ID: 2186601
I solved it!!

First, I changed the 'Sendnames' object reference variable to 'Item'(don't know why this helped but it seemed to).  I then put the "Set objRecipient = ..." line in a ForAll loop.  This goes through each value in the 'SendTo' field and adds it as a recipient to the Outlook message.  Here is the code:

Forall n In Item.Values
          Set objRecipient = objMessage.Recipients.Add (n)
     End Forall

Thanks for your help earlier!
0
 
LVL 9

Accepted Solution

by:
Arunkumar earned 200 total points
ID: 2191230
Hi Sammy !

Points ?

Or

Cancel ?

:-)
Arun
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

You’ve got a lotus Domino web server, and you have been told that “leverage browser caching” is a must do. This means that we have to tell the browser everywhere in the web to use cache. In other words, we set (and send) an expiration date in the HT…
For beginners of Lotus Notes user this is important to know about the types of files and their location supported by IBM Notes. Mostly users are unaware about how many file types are created and what their usages are. This Article is fully dedicated…
Kernel Data Recovery is a renowned Data Recovery solution provider which offers wide range of softwares for both enterprise and home users with its cost-effective solutions. Let's have a quick overview of the journey and data recovery tools range he…
There may be issues when you are trying to access Outlook or send & receive emails or due to Outlook crash which leads to corrupt or damaged PST file. To eliminate the corruption from your PST file, you need to repair the corrupt Outlook PST file. U…
Suggested Courses

590 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question