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

what is the EASIEST way to programmatically send a simple email? 1

Status
Not open for further replies.

tristero

Programmer
Jan 24, 2003
95
0
0
US
i need my foxpro program to send me an e-mail after it is automatically run each morning on another computer, to tell me that it has run successfully.


nothing fancy... just the essentials.

i'd like to avoid messing with outlook as much as possible.

Dan Trenz
Ann Arbor, MI
 
Ann,

You could use BLATT. It's a simple bit of freeware that can send messages unattended. It comes either as a program, which can be run from the command line or via VFP's RUN command, or as a DLL, which you can call from VFP.

You can grab a copy (along with a Readme file) from:

Mike


Mike Lewis
Edinburgh, Scotland

My Visual Foxpro web site: My Crystal Reports web site:
 
haha, my name is Dan, i live in Ann Arbor. haha


anyway, i believe i was on your foxpro site and i saw your ShellExcecute code but it doesn't send programmatically.


i can't believe that foxpro requires another app just to send a simple e-mail...

i've been coding php lately and i'm used to using mail().

doesn't get much easier than that.




Dan Trenz
Ann Arbor, MI
 
Dan,

haha, my name is Dan, i live in Ann Arbor.

Oops. That's what comes of trying to finish my messages before my tea gets cold.

i believe i was on your foxpro site and i saw your ShellExcecute code but it doesn't send programmatically.


ShellExecute() is definitely the simplest method, but it does not work unattended. It requires the user to click the Send button. That's why I didn't recommend it in your case.


i can't believe that foxpro requires another app just to send a simple e-mail...

Well, one of the strenghts of VFP is that it can work with many other types of software. If VFP cannot do something by itself, it can always call on the services of another component to do so.

Mike



Mike Lewis
Edinburgh, Scotland

My Visual Foxpro web site: My Crystal Reports web site:
 
true, but it can handle URLs and browser navigation, i would think that email handling would be the next logical step...



perhaps vfp 9.0?

Dan Trenz
Ann Arbor, MI
 
See faq184-3840 or (newer)
This is a standalone VFP proc I wrote that sends email.

Simply:
Code:
lRes=SendMail( 'My.mail.server.com', ;
'myReturnAddress@MyServer.com',;
'DestinationAddress@YourServer.com',;
 'My Message Subject',;
 'My Message Body, line 1'+chr(13)+chr(10)+'Line 2, etc...' )
One issue, though, is that it needs access to an SMTP server, just like outlook would. It's possible PHP IS an SMTP server, and would be able to send email without an external server, so this is one slight difference.

There are a dozen other methods of sending email listed in the FAQ's here, too!
 
thanks... which is the one i want?

SendSmtpEmail or WS2_32.DLL?


Dan Trenz
Ann Arbor, MI
 
oh nevermind, i figured it out. but i got a "RCPT Failed" error

Dan Trenz
Ann Arbor, MI
 
got it working, thanks so much!

Dan Trenz
Ann Arbor, MI
 
tristero,

I provided a little code that demonstrates most of the major ways to send email from VFP...you could try it and pick one that works for you...my post is near the bottom of the following thread:

Emailling from within VFP
thread1251-797973

boyd.gif

[sub]craig1442@mchsi.com[/sub][sup]
"Whom computers would destroy, they must first drive mad." - Anon​
[/sup]
 
tristero,
I'd like to know what was causing the RCPT failed error, if it would make the basic code work better for others....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top