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

emailing thru foxpro

Status
Not open for further replies.

PeriyurParthi

IS-IT--Management
Jul 18, 2001
258
IN
hi professional,

i need to send an email from vfp. ie all my reports have to send thru email, can u just help to come out of this project, need a detail solution and examples

pls help
parthi
 
any body knows how to write a mail programme using v.foxpro

help pls
regds
parthi
 
Hi parthi,
Try to look on this sample on your machine
...\Samples\Vfp98\Solution\OLE\sendmail.scx

This will allow you to send emails with attachements.
But as you stated, you want to send reports via email. Sending reports itself is not easy to send.
1) You have to install acrobat printer.
2) Print your report to file through acrobat printer.

Then you can attach this print file in your email.

I hope this will move you in right direction.


 
thanks mishra

i dont have msdn and samples in my system, can u just give an idea to send a mail useing vfox .. pls
cheers
parthi
 
Hi
Have you tried the thread
How can I send an Email using OUTLOOK from VFP?
faq184-766
Hope that helps.

ramani :-9
(Subramanian.G)
FoxAcc
ramani_g@yahoo.com
LET KNOW IF THIS HELPED. ENOUGH EXPERTS ARE HERE TO HELP YOU OUT! BEST OF LUCK :)
 
Since I do not like using Outlook because of its ability to pass viruses without your knowlwdge, I use eudora.

sample prg reading from a DBF to create a eudore email
[tt]
gcEmailExe = IsFileInReg("Eudora.exe")
lcFile = "c:\temp\emm.msg" (or what every name you want with a msg extension)
lnFileNo = fcreate(lcfile)
if lnFileNo < 0.5
replace EM2VEND.ERROR_NO with lnFileNo
fclose(lnFileNo)
loop
endif
fputs(lnFileNo , &quot;To: &quot; + lower(alltrim(EM2VEND.EM_TO)))

fputs(lnFileNo , &quot;From: &quot; + lower(alltrim(EM2VEND.EM_FROM)))

fputs(lnFileNo , &quot;Subject: &quot; + Proper(alltrim(EM2VEND.EM_SUBJECT)))

fputs(lnFileNo , &quot;Cc: &quot; + iif(empty(EM2VEND.EM_CC) , &quot;&quot; , lower(alltrim(EM2VEND.EM_CC)) + &quot; &quot;)

fputs(lnFileNo , &quot;Bcc: &quot; + iif(empty(EM2VEND.EM_BCC) , &quot;&quot; ,
lower(alltrim(EM2VEND.EM_BCC)) + &quot; &quot;)

fputs(lnFileNo , &quot;Attached: &quot; + iif(empty(EM2VEND.EM_ATTACH) , &quot; &quot; ,
alltrim(EM2VEND.EM_ATTACH) + &quot;;&quot;)

fputs(lnFileNo , &quot;X-Attachments: &quot;+ iif(empty(EM2VEND.EM_ATTACH) , &quot; &quot; ,
alltrim(EM2VEND.EM_ATTACH) + &quot;;&quot;)
*
* e-mail text
*
fputs(lnFileNo , &quot;&quot;) && Warning this must be a null for eudora to read the text
fclose(lnFileNo)
if !empty(EM2VEND.EM_MSG)
copy memo EM2VEND.EM_MSG to (lcFile) additive
endif
= runexe(gcEmailExe , lcFile)
[/tt]
David W. Grewe
Dave@internationalbid.com
ICQ VFP ActiveList #46145644
 
Well, I don't know anything about viruses through Outlook but I do know that it is very simple to use.

Here is some sample code ... which will send the contents of a textfile to someone.
You can add more recipients by executing the ADD line multiple times.

release all like o*
oApp = createObject(&quot;Outlook.Application&quot;)
oMail = oApp.CreateItem(0)
oMail.recipients.add(&quot;someone@someplace.com&quot;)
oMail.subject = &quot;Test Mail&quot;
oMail.body = filetostr(cTextfilename)
oMail.send()
release all like o*



Don
dond@csrinc.com

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top