by Jack Wheeler (jwl1@jps.net)
Alpha Five version 5 will have email capability (see Alpha Five Becomes Web-savvy), but I just read a neat trick that I adapted to version 4. In this article, Jeff Levy explains how to send emails using shortcuts on the desktop. He points out that both Netscape Communicator® and Internet Explorer® will accept command-line arguments for their mail.
For example, I use Netscape, and if I place this shortcut on my desktop, it will launch Netscape in email mode to Dr. Wayne:
C:program files\netscape\program\Netscape.exe mailto:DrPWayne@juno.com
This shortcut will send email to Dr. Wayne and to me:
c:\program files\netscape\program\netscape.exe mailto:DrPWayne@juno.com,jwl1@jps.net"
This seemed so easy that I figured I could do it in Alpha Five. I could use a button, an OnKey form event or an OnMouse user object event to launch my email. I decided I would go with OnKey and capture the {enter} key to launch my email.
I have an email address field on my form which is named Email. If the field is not blank and I hit the enter key, Netscape Composer will open with the address of the field in the composer. Here is the code on the forms OnKey event:
if this.active()="email" then
if a_user.key.value="{enter}" then
if email.text="" then
end
end if
if a_user.key.event="down" then
a_user.key.handled=.t.
command="C:\program files\netscape\communicator\program\Netscape.exe Mailto:"+email.text
sys_shell(command)
end if
end if
end if
I hope you find this useful!
| Editor's note: This is a nifty trick. The first time I tried it I could not get it to work, and using the debugger I came up with an "out of memory" condition. Only after reporting this to Jack did I realize that I had left a backslash out of the path specification for Netscape. If this program doesn't work for you, check your path specifications carefully! |
2/6/00
Don't forget, we need your feedback to make this site better!