Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Error message
Message
 
To
21/09/2000 11:02:31
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Miscellaneous
Thread ID:
00418944
Message ID:
00419068
Views:
32
>Hey Bret,
>
>Here's the code:
>
> ** NOW BEGINNING FAXING VIA OUTLOOK PROCEDURE **
> *cAddress = "[fax:404-371-5423]"
> cAddress = "jkt6@cdc.gov"
> cSubject = "Testing AutoFaxing Error Reports"
> cBody1 = "This is a test, this is only a test. "
> cAttachment1 = "C:\MY DOCUMENTS\" + of2w.doc_filename
>
>*!* oOutlook = CREATEOBJECT("Outlook.Application")
> oMailItem = oOutlook.CreateItem(0)
>
> WITH oMailItem
>
> .To = cAddress
> .Body = cBody1
> .Subject = cSubject
> .Attachments.Add(cAttachment1)
> *.Attachments.Add(cAttachment2)
> .Send()
>
> ENDWITH

I dont know if it makes a difference, but I use the following code to add recipients and attachments.

WITH omailItem
WITH .Recipients.Add(cAddress)
.Type = 1
ENDWITH
IF NOT EMPTY(ccwhom)
WITH .Recipients.Add(mccc)
.Type = 2
ENDWITH
ENDIF
IF NOT EMPTY(cAttachment1)
mcfile = ALLTRIM(cAttachment1)
WITH .Attachments.Add(mcfile)
* For some reason the type appears to
* be read only, but the mai goes through OK
* .Type = olByValue
IF NOT EMPTY(attachdesc)
.DisplayName = attachdesc
ELSE
.DisplayName = mcsubject
ENDIF
ENDWITH
ENDIF
* Since we have no way now to indicated who this
* mail came from, we will put the originator's name in the body
*
IF NOT EMPTY(mailbody)
.Body = 'Message originated from: '+mcfrom+CHR(13)+CHR(13)+mailbody
ELSE
.Body = 'Message originated from: '+mcfrom
ENDIF
.subject = mcsubject
.Importance = 1
* Send it!
.Send
ENDWITH

Hope this helps, but my way could be just another way to kill the cat....

Another question would be to ensure you are not somehow release a object reference before you are done with it or deleting an attached file before it could be sent.
Bret Hobbs

"We'd have been called juvenile delinquents only our neighborhood couldn't afford a sociologist." Bob Hope
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform