Link to home
Start Free TrialLog in
Avatar of thorner
thorner

asked on

Emailing from a form

I have a form that updates a database and I need to send an email message telling me when that database
has been updated.  How do I do it?
Avatar of jjmartin
jjmartin

What are you using to email with?  Is this over an office LAN using an existing email package (MSMail, Lotus Notes).  If so, what type of mail package are you using?
Assuming VB5...

Make sure you have checked the Microsoft MAPI controls under the Project menu.

Drag both the MAPI Session control and the MAPI Message control to your form.

I named my controls "mapSession" and "mapMessage"

add this to your Form_Load event:

Private Sub Form_Load()
   mapSession.SignOn
End Sub


add this to your function:

With mapMessage
  .SessionID = mapSession.SessionID
  .Compose
  .RecipDisplayName = "Merritt, Jay"
  .MsgSubject = "Test"
  .MsgNoteText = "IT WORKED " & Chr(13)
  '.AttachmentPathName = "C:\Test.txt"
  .Send
End With

since your signon is in the form_load, you can send multiple messages without signing on again.

have fun!
Avatar of thorner

ASKER

Okay, I messed up.  I forgot to say that it is for a VB-CGI application.  It's the usual submit form and all of that good stuff.  Sorry for the mix-up.
Avatar of thorner

ASKER

I already know how to do the database stuff.
If you are using Microsoft SQL Server you can use xp_SendMail.

I've found it to be very easy.

Otherwise you need to be more specific your e-mail options.
Avatar of thorner

ASKER

I'm using an Access db with an O'reilly webserver.  I just want a dummy message sent.  The email message doesn't have to be anything special.  Is there perhaps a CGI command you know that will do this with VB?
How do you send mail manually?

What kind of e-mail system do you have?
Avatar of thorner

ASKER

We use Pegasus mailer.  I don't know if you're familiar with that or not.
Sorry...
You need to use window existing build in program to "link" your database with the existing network or window program. Also you need to use pop-up function from clien/server network. Still confuse? You will get it over.
ASKER CERTIFIED SOLUTION
Avatar of Zak031598
Zak031598

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial