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

how make to conect to smtp for send mail and pop3 to Recive(VFP)

Status
Not open for further replies.

pregunton

Programmer
Jul 14, 2002
4
0
0
AR
Hi i need add to my app the posibility of conect to a smtp to send mail and pop3 to recived i need make that with VFP and without use external resources(not see32.dll). Can anybody help me pls?
Tnx
 
tnx but i find to learn and free solution for my problem.
I know that can make with VFP but i dont know how.
Tnx Again
 
Try this:
* Create an instance of a form, and then add the MSMAPI.MAPISession and
* MSMAPI.MAPIMessages OLE controls to that form:

oform = CreateObject("form")
oform.addobject("Session1","olecontrol","MSMAPI.mapiSession")
oform.addobject("Message1","olecontrol","MSMAPI.mapiMessages")

* Call the Signon method of the MAPISession control. If the user is not
* logged into mail, this will prompt the user to sign on. This also sets
* the SessionId property for the MAPIsession control:

oform.Session1.signon

* Set the SessionId of the MAPIMessage control to the SessionId of the
* MAPISession control, which was just obtained:

oform.Message1.sessionid = oform.Session1.sessionid

* Compose an e-mail message and set the subject line and Message text:

oform.Message1.compose
oform.Message1.msgsubject = "Memo from my FoxPro app"
oform.Message1.msgnotetext = "This works"

* Sends the e-mail message. The (1) is required to send the message.

oform.Message1.send(1)

* Optionally, sign off from mail:

oform.Session1.signoff

* Optionally, release the objects if they are no longer needed:

release oform
 
Or this:
Code:
DECLARE INTEGER ShellExecute IN shell32.dll ; 
  INTEGER hndWin, STRING cAction, STRING cFileName, ; 
  STRING cParams, STRING cDir, INTEGER nShowWin

lcMail = "mailto:john@mycompany.com"+ ;
  "?CC= boss@mycompany.com&Subject= Meet for lunch"+ ;
   "&Body= Please join me for a sandwich at noon." 
ShellExecute(0,"open",lcMail,"","",1)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top