Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to send one email to multiple recipients using Redemption

Status
Not open for further replies.

Jerzy Peter

Programmer
Mar 11, 2020
2
CA
Hello everyone. This is my first post. I would appreciate any help to resolve my problem.
I'm writing a procedure to send email from our VFP application using Redemption.
Here is the stripped code that is working for one recipient address / one CC address:

loOutLook = CREATEOBJECT("Outlook.Application")
loNamespace = loOutLook.GetNamespace("MAPI")
loNamespace.Logon

loSafeItem = CREATEOBJECT("Redemption.SafeMailItem")
loMAPIUtils = CREATEOBJECT("Redemption.MAPIUtils")

loItem = loOutLook.CreateItem(0)
loSafeItem.Item = loItem

loSafeItem.Recipients.Add(lcReceipientAddress)
loSafeItem.cc = lcCCAddress

loSafeItem.Recipients.ResolveAll()
loSafeItem.Send
loMAPIUtils.DeliverNow()

I wanted to send one email to multiple recipients:
When I assign 2 addresses to the variable lcReceipientAddress: lcReceipientAddress="one@abc.com;two@abc.com" with semicolon as separator it doesn't work. It sends email to CC address.

Thanks, [smile]
 
Welcome to the forum, Jerzy.

With the Redemption object, you cannot use the Add method to add a semi-colon-delimited list of recipients. You have to add each one individually, with successive calls, then call ResolveAll() to resolve them.

Alternatively, you can set the To, CC an BCC properties to a delimited list of email addresses.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top