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

Email 2

Status
Not open for further replies.

lashwarj

IS-IT--Management
Nov 1, 2000
1,067
US
How do I take a field and make it an email address

The user will enter the value as test@test.com

how do I make a command button that will, when clicked open the default email client and make a message for that email address
 
How to send e-mail using MAPI session

* 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
Attitude is Everything
 
ok can you simplify that, if i had a field emailaddress , subject and memo where would they go in that
 
lashwarj,

Maybe this is more simple:

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)
 
Well, that's a nice simple message producing code. But can you also send the message without having the have the user click the 'send button'? IOW something like:

Code:
 ShellExecute(0,"send",lcMail,"","",0)

That is, where do I find the details of the ShellExecute function syntax? BTW, when I ran the Depends program on Shell32.dll, it had lots of ShellExecute thingees, but none of them seemed to be plain ShellExecute; they all were something like ShellExecuteEx or RealShellExecute. Doesn't the DLL have to have an exact match (including capitalization) for the something you're calling? Or did I just miss it in the 600+ entries in shell32.dll? Dave Dardinger
 
DEDMOD

The reason I proposed the code is because the user had to input the e-mail address himself, so I figure at that point he might as well hit the send button himself. Unfortunatly that is the limitation of this procedure, you cannot send without hitting the send button and you cannot prevent the user from cancelling the message.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top