Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Paul Michael
  Where is Paul Michael?
 Connecticut - United States
 Paul Michael
Subject: VFP Email - please assist
Thread ID: 22108 Message ID: 22108 # Views: 55 # Ratings: 0
Version: Visual FoxPro 6 Category: General VFP Topics
Date: Wednesday, April 09, 2003 3:43:30 PM         

Good morning Foxpro Guru's :<)

To created a small email prg (vfp6.0) that selects all records that contain an 'N' in the "signed" field, along with the resuired fileds to show in the email body and send them to the MS outlook 2000 outbox.

Thank you,


MS Outlook: "An error occured while attempting to open the Windows Address Book, MAPI 1.0 [00000220]"


VFP Program Error: "OLE IDispatch exception cone 0 from MAPIsession Login has failed"

Note: I'm not utlizing the address book in MS Outlook 2000. I have a profile called 'testmail' {Use this profile selected in Outlook).

The fields I need to show in the Form/Grid hence the data from these field appearing adjcent of the nanes are in paretisses ""
May table is called Mails.dbf

"Tracking Number" = Trackno
"Carrier Name" = Carr
"Service Name" = Service
"Date Received" = Rdate
"Time Received" = Rtime
"Rcv Clerk ID" = Clerkid
"Sender Name" = Sndname
"Sender Address" = Sndaddr
"Sender City" = Sndcity
"Sender State" = Sndstat
"Sender Zip" = Sndzip
"Phone Number" = Recvrphone


Create Cursor testmail (signed c(1), packnumber i, Rdate d)
For ix=1 To 100
Insert Into testmail Values ;
(Chr(Asc('a')-1+Ceiling(Rand()*26)), ix, Date()-ix)
Browse For signed = 'n' && Would email these

Local lcTarget, lcCurdir, oForm
lcCurdir = Sys(5)+Curdir()
lcTarget = 'pm007_@email.com' && Sending all to myself for testing
Select testmail

oform = Createobject("form")
With oform.oMessage
.sessionid = oform.oSession.sessionid
Scan For siged = 'n' && Would email these
.msgsubject = "Notification"
.msgnotetext = ;
"Package Number: "+ Transform(packnumber)+Chr(13)+Chr(10)+;
"Package date :" + Transform(Rdate,'@YL')+Chr(13)+Chr(10)+;
"Best Regards"
.RecipAddress = lcTarget
.RecipType = 1
Set Default To (lcCurdir)


VFP Email - please assist Posted by Paul Michael @ 4/9/2003 3:43:30 PM
RE: VFP Email - please assist Posted by Jamie Osborn @ 4/9/2003 9:50:17 PM