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

Outlook mailing from VFP

Status
Not open for further replies.

joga

IS-IT--Management
Aug 8, 2003
6
US
Hi,
I have a cursor with 100 records (name, email adress). On a form, the user enters his name, email adress, subject, body text, and attachments.

Now, my problem is: How do I create 100 messages in the Outlook 2000 outbox?

Any ideas, code samples, or links on OLE Automation with Outlook 2000 would be highly appreciated.

Thanks, JoGa
 
I use wwIPStuff from West-wind.com. You have to install the wwipstuff class. The following will create 1 e-mail message, or more if you put it in a DO or FOR loop.


loIP = CREATEOBJECT("wwIPStuff")

loIP.cRecipient = ALLTRIM(m.to_email)

loIP.cCCList = 'admin@yoursite'
loIP.cBCCList = ''

loIP.cSubject = 'Subject Line for ';
+ALLTRIM(m.desc);
+' ';
+DTOC(m.date)

loIp.cMessage = CHR(10);
+'This e-mail was Automatically generated'; +CHR(169);
+CHR(10);
+CHR(10);
+'My e-mail address is: ';
+m.email

IF !loIP.SendMapiMail()
? loIP.cErrorMsg
ENDIF


Hope this helps
AJF
 
#DEFINE MAILITEM 0
#DEFINE IMPORTANCELOW 0
#DEFINE IMPORTANCENORMAL 1
#DEFINE IMPORTANCEHIGH 2

oOutLookObject = CreateObject("Outlook.Application")
oEmailItem = oOutLookObject.CreateItem(MAILITEM)

WITH oEmailItem
.Recipients.Add("moe@3stooges.com") && uses the Recipients collection
.Subject = "Automation sample"
.Importance = IMPORTANCENORMAL
.Body = "This is easy!"
.Attachments.Add("c:\mydir\sample.txt") && Note that the fully qualified path and file is required.
.Send
ENDWITH

RELEASE oEmailItem
RELEASE oOutLookObject
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top