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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Email Question for Redemption and/or CDO Users

Status
Not open for further replies.

JRB-Bldr

Programmer
May 17, 2001
3,281
US
Like many others I am trying to get around the ClickYes issue when sending emails and FAX's through Outlook 2000 SP-3.

I have tried the ClickYes utility, but it did not seem to work and eliminate the need to click a response. I am still awaiting a response from the vendor on why it did not work.

In the mean time I am investigating other approaches including Redemption and CDO which I have seen referenced in this forum.

I need to send both Emails and FAX's and using Outlook 2000 (on Win 2K PC's) appears to handle both reasonably well. But the Click Yes issue is a problem.

I downloaded Redemption, registered the DLL and attempted to run some of the example VFP code that I have seen posted, but no email was sent. And I do not know if Redemption will send FAX's through Outlook. If someone has knowledge of this product I would appreciate their suggestions and/or advice.

Additionally I have seen mention of using CDO, but I am uncertain of its capabilities (email AND FAX's?) and it is unclear which version to use (it seems to be OS specific). Anyone's advice/suggestions who has personal experience with this approach would also be welcome.

Your advice and suggestions are most appreciated.

Thanks,
JRB-Bldr
 
JRB-Bldr

For information on CDO look at faq184-1769.

I would recommend though using the class from Rick Strahl, with which I have had good result (ie. it never fails to send the e-mail).

I'm not sure about faxing with CDO or MAPI.

Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Thanks Mike for your response.

While awaiting a reply I played around with Redemption and finally got it to work. The sample VFP + Redemption code that I found listed on this forum did not work well and needed to be tweaked a little to SEND.

At this point I now have Redemption sending both emails and FAX's through Outlook 2000 SP-3 (utilizing both Internet email and M$ Shared FAX Mail Transport services) without the need for the user to Click Yes.

Thanks again,
JRB-Bldr
 
JRB-Bldr

Glad you solved your problem.

Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Hello JRB

I read you post in Tek-Tips regarding Redemption:

At this point I now have Redemption sending both emails [...] through Outlook 2000 SP-3 (utilizing both Internet email and M$ Shared FAX Mail Transport services) without the need for the user to Click Yes.

I'm having great difficulties in finding information about using redemption, installing it and using it as well.

What I need to do is very simple. Would you consider coaching me a little so I can use Redemption?

Thanks,

Daniel Lamarche
dlamarche@globale.com
 
Yes Mr. Gagnon (sounds french in pronunciation to me at least) I did go to his site and send numerous emails to many locations and printed 19 pages of snippets gathered all over. Unbelievely none of the coce I gathered worked properly!

I finally found out from Dmitri about registering the developer's version of Redemption. The reply was to use a line tike the following (Wonder why the double quotes. Maybe because there could have spaces in the path?":

regsvr32.exe "c:\somefolder\redemption.dll"

I do some Access development with (of course) lots of vba. So I'm at least somehow intelligent if things make sense or are well explained.

My app is quite simple. In an Access form there is a subform with some participants to the seminar appearing in the main form. I managed to have all the participants in the subform sent to a Sub that organises them so that they appear in the To box of an email with the seminar name in the Subject box and the confirmation in the Body. There are hundreds of vba lines in this app. So I'm ... fine with programming.

I went on to check carefully the examples in the Redemption site but I cannot make the email appear with the recipients resolved in the To box.

If you're fine with coaching me a little (I won't bother you with my project's code) then I promise that I will help other here with some of my own findings.

Before I posted my specific question I wanted to explain my situation and politely wait for your ok about this.

Daniel Lamarche
Montreal, Quebec



 
Example:
oOutlook = CREATEOBJECT("outlook.application")
oemail = CreateObject("Redemption.SafeMailItem")

oItem = oOutlook.CreateItem(0)
oemail.Item = oItem &&Assign Redemption to Outlook Item
 
Hi jcrudisill.

I tried this many times. Actually I now know it by heart. I was never able to make that code (and the rest of course) to work. The email appears but no recipients in the To box.

How do you declare the variables (as Object or the specific type) and at what point do you resolve the recipients?

Daniel
 
How do you declare the variables (as Object or the specific type) and at what point do you resolve the recipients?

As far as I know the recipients have to be valid recipients.

sItem.Recipients.Add("user@domain.com")
sItem.Recipients.ResolveAll()


Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Daniel -
Here is the VFP7 code that I am using with Redemption and Outlook to send emails (note - I am using similar code to send FAX's via Redemption/Outlook as well)

* ==================================
<Do Whatever>

* --- If First Email To Send ---
IF mnEmailCnt = 1
* --- This needs to be done before trying to access the Redemption methods and Properties ---
PUBLIC oRedem, oOutlook, oNS
oRedem = CREATEOBJECT("Redemption.SafeMailItem")
oOutlook = CREATEOBJECT("Outlook.Application")

oNS = oOutlook.GetNamespace("MAPI")
oNS.Logon
ENDIF && IF mnEmailCnt = 1

=SendEmail(mcEmailAddr, mcSubject, mcBodyText, mcDOCFile, mcXLSFile)

* --- If Last Email Sent ---
IF mnEmailCnt = mnTotEmail
oNS.Logoff

RELEASE oNS
RELEASE oOutlook
RELEASE oRedem
ENDIF && IF mnEmailCnt = mnTotEmail
<Do Whatever>


* ------------------------------------
FUNCTION SendEmail
PARAMETERS mcEmailAddr, mcSubject, mcBodyMsg, mcAttach1, mcAttach2
*LOCAL oRedem, oOutlook, oNS
LOCAL oMail

#DEFINE MAILITEM 0
#DEFINE IMPORTANCELOW 0
#DEFINE IMPORTANCENORMAL 1
#DEFINE IMPORTANCEHIGH 2

oMail = oOutlook.CreateItem(0)

oRedem.ITEM = oMail

* --- Code To Insert Non-Default Email FROM: Address ---
* --- Not Necessary If Using Default Outlook Address ---
FromTag = oRedem.GetIDsFromNames("{00020386-0000-0000-C000-000000000046}", "From")
FromTag = BITOR(FromTag, 0x1E) && VFP Version
FromTag = ALLTRIM(STR(FromTag,20)) + CHR(0) && Convert to String - PT_STRING8 Format

WITH oRedem
.Item = oMail
.To = mcEmailAddr
.FIELDS[FromTag] = "MyCompany <Leads@MyISP.com>" && Insert Alternate FROM:
.ReplyRecipients.ADD("Reply-To <Reply-To@MyISP.com>") && Insert Alternate REPLY-TO:
.Subject = mcSubject
.Importance = IMPORTANCELOW
.Body = mcBodyMsg
.Attachments.ADD(mcAttach1) && Fully Pathed DOC File Attachment
.Attachments.ADD(mcAttach2) && Fully Pathed XLS File Attachment
.Send
ENDWITH

* --- When Done, RELEASE The Objects ---
RELEASE oMail

RETURN .T.

* ==================================
The above code was set up to send 100's of programatically generated client-specific emails automatically.
After a good bit of trial and error, it now is working well.

One thing I do require of my users is that they already have Outlook open and running as a background task prior to launching this routine. I have not yet determined if this is 100% REQUIRED, but it works that way, so why tempt fate.

Good Luck,
JRB-Bldr
 
An alternative to "Redemption" is described in faq184-2677 which requires no DLL's, OCX's and no $....
 
Hi Mike,

will you be kind enough as to direct me to Rick strahl's email class.

thanks!

 

nmail = allt(lopstat.pemailcon)
nattach=sfile+NARRAY(I,1)
#DEFINE olMailItem 0
oOutlook = CREATEOBJECT("outlook.application")
oemail = CreateObject("Redemption.SafeMailItem")
oItem = oOutlook.CreateItem(0)
oemail.Item = oItem

LOCAL rbody,d,n,dbody
lmodify = strtran(users.notes,"CDATE",nmonth)
dbody = lmodify+Chr(13)

WITH oemail
.subject="Wages for "+dtoc(edate-1)
.body= dtoc(edate-1)+CHR(13)+CHR(13)+dbody
.Recipients.Add(nmail)
.Attachments.Add(nattach)
.save()
.send()
ENDWITH


Once you assign the item to redemption you can treat it just like Outlook. The '.Save' is optional.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top