email using redemption

R

Richard

Hi

I am using redemption to forward emails.

When I do not display the item, it will send without the body(message). But
if I display the item first, then close it and send, everything is sent
including the message.

Is there a way around this. It would be nice if there were no window opening
and closing when the code is running.

Many thanks in advance
Richard

Part of code:

Set myFolder = myNameSpace.GetDefaultFolder(olFolderDrafts)
Set myItem = myFolder.Items
Set Utils = CreateObject("Redemption.MAPIUtils")

qryResults.MoveFirst

Do Until qryResults.EOF

If a > Count Then

Set myTempItem = CreateObject("Redemption.SafeMailItem")
Set FWDItem = myItem.Item(1).Forward

FWDItem.to = qryResults!EMAIL
FWDItem.Display 'if I don't display, the message is sent
without message.
FWDItem.Close olSave
DoEvents
FWDItem.DeleteAfterSubmit = True

myTempItem.Item = FWDItem
myTempItem.Send
 
D

Dmitry Streblechenko

What happens if you display the message body (MsgBox myTempItem.Body) before
sending it?

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
 
R

Richard

Hi Dmitry

I think I know where the problem is..

If I forward a new email (I forward the item from inbox to drafts), the
message is empty, but if I drag an old email (i.e. I drag and drop from
inbox to drafts) it works okay.

Anyway sorry for the previous post, there wasn't any item in the drafts
folder.

How do I forward the item, and make it show in the mytempitem.body?

Richard
 
D

Dmitry Streblechenko

Depends on where the original message to be forwarded comes from. How do you
make a decision which message needs to be forwarded?

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
 
R

Richard

Hi Dmitry

The message is email we send to clients weekly. So, we create a new message,
save it to the drafts folder and forward it out to our clients.

Richard
 
D

Dmitry Streblechenko

I mean where does it come from on your code level? How do you create it?Why
don't you save it as an MSG file, then for each recipient call
Application.CreateItemfromtempate, add a recipient, send it, do that again.
Or you can use Safe*Item.Import in Redemption to import an MSG file.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
 
R

Richard

Well let me see if I understand your questions.

The code is from MS Access, in a form where I have a command to send emails.
This will load clients email to a temp table and the code will loop through
the table.

I don't think I know what a msg file is. I am not that good in coding, its a
code I got from someone else and did some changes to it. I think what you
are suggesting is beyond my scope, but if you have a sample code I could
use, I would like to take a look at it.

Richard
 
R

Richard

Dmitry

I managed to do it using the createitem method.

Many thanks for your help and advice. Appreciate it.

Richard
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top