PDA

Click to See Complete Forum and Search --> : Automatic E-mail ??


VB_Novice
Apr 4th, 2000, 03:51 AM
Hello,

I am using VB 5 as an interface to a database to record details of employees attending work. If they have bad attendance I would like to be able to automatically genertate a standard e-mail which would be sent to them using their e-mail address, which is stored in the Employee DB table.

I have Pegasus Mail as an e-mail package and I was wondering how I would go about trying to accomplish this task and what sort of coding would be necessary.

I hope someone can help.
Thanks,
Andy...........

Clunietp
Apr 4th, 2000, 01:47 PM
I doubt Pegasus is as programmable as MS Outlook is, but you can use MAPI or CDO to send mail via VB...sorry, I don't have any good links for you though...

shovels
Apr 5th, 2000, 10:43 PM
Hi,
You can try the following code, which works by calling the default e-mail application:

Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long

(Add this code at the top of your form, and then call the function using this line of code)

ShellExecute Me.hwnd, "open", "mailto:anyone@home.com", vbNullString, vbNullString, 0


Hope this helps,
shovels