Solved

Emailing from a form

Posted on 1998-05-27
11
132 Views
Last Modified: 2010-05-03
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?
0
Comment
Question by:thorner
11 Comments
 
LVL 3

Expert Comment

by:jjmartin
ID: 1461817
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?
0
 
LVL 1

Expert Comment

by:JayMerritt
ID: 1461818
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!
0
 

Author Comment

by:thorner
ID: 1461819
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.
0
 

Author Comment

by:thorner
ID: 1461820
I already know how to do the database stuff.
0
 
LVL 1

Expert Comment

by:JayMerritt
ID: 1461821
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.
0
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 

Author Comment

by:thorner
ID: 1461822
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?
0
 
LVL 1

Expert Comment

by:JayMerritt
ID: 1461823
How do you send mail manually?

What kind of e-mail system do you have?
0
 

Author Comment

by:thorner
ID: 1461824
We use Pegasus mailer.  I don't know if you're familiar with that or not.
0
 
LVL 1

Expert Comment

by:JayMerritt
ID: 1461825
Sorry...
0
 

Expert Comment

by:qizhizhu
ID: 1461826
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.
0
 

Accepted Solution

by:
Zak031598 earned 20 total points
ID: 1461827

I found two ways to send mail using the Pegasus system.   The first and probably the
most reliable is to create a tmp file using the following format:

"From:" + strFrom + vbCrLf
"Date:"  Date$ + vbCrLf
"To:" + strName + vbCrLf
"Subject:" strSubject + vbCrLf
vbCrLf + vbCrLf
strMessage

Then you can mail the file from a shell command using the Pegasus Exe with some
command line params.... I think that it is "WinPMail /f tmpMsg.txt"  I can get back to
you if this isn't correct.  I don't have PMail on this machine so I can't verify it.

The other way is to create the same file in the users PMail directory using a unique filename + .CNM.  The problem with this is that you need access to the PMail
directory.  The advantage to using this (or at least it was for me) is that by appending
to a single file such as DBUPDATE.CNM you will not get flooded with new mail
messages.


0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now