• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 159
  • Last Modified:

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?
0
thorner
Asked:
thorner
1 Solution
 
jjmartinCommented:
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
 
JayMerrittCommented:
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
 
thornerAuthor Commented:
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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
thornerAuthor Commented:
I already know how to do the database stuff.
0
 
JayMerrittCommented:
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
 
thornerAuthor Commented:
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
 
JayMerrittCommented:
How do you send mail manually?

What kind of e-mail system do you have?
0
 
thornerAuthor Commented:
We use Pegasus mailer.  I don't know if you're familiar with that or not.
0
 
JayMerrittCommented:
Sorry...
0
 
qizhizhuCommented:
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
 
Zak031598Commented:

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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now