?
Solved

E-mail & visual basic forms

Posted on 2003-02-27
11
Medium Priority
?
156 Views
Last Modified: 2013-11-25
I created a from in visual basic.  When the user press submit, I want the program to send an e-mail to me containing all the info from the form.  Is it possible to do it, and if so how do I do it?  Is there some site where I can look at examples??

Thanks.
0
Comment
Question by:enigrini
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
11 Comments
 
LVL 27

Expert Comment

by:Dabas
ID: 8032516
Lets divide what you want to do into several parts:

1) You want the program to send you an email
2) You want the program to send the info on the form.

Are you having problems with both, or just one of them?

As to if it is possible to do, the answer is a definite yes!

Please be more specific though as to how the info is kept in the form. Textboxes only? Also comboboxes? Listboxes??

Dabas
0
 
LVL 18

Expert Comment

by:Sethi
ID: 8032536
The easiest and the most liked way in this forum for sending emails through VB is by using vbSendMail DLL that can be freely downloaded from this site:
http://www.freevbcode.com/ShowCode.Asp?ID=109

The other is using MAPI controls on VB. Look at the following links for tutorial and sample code of MAPI.
Use the following links to understand MAPI:
http://abstractvb.com/code/code713.asp
http://www.thescarms.com/vbasic/MapiEmail.asp

There are two other ways:
1.     CDO
2.     Outlook Objects
These two require certain applications like Microsoft Outlook or Exchange server to work efficeintly.
0
 
LVL 1

Expert Comment

by:tampabay420
ID: 8033116
if you know the user is going to have outlook, i'd suggest that- it's the easiest way to do it...

Sub SendMail(REC$, SUBJ$, BODY$)
    ' Tampa Bay  110100100
    ' Code written 5/08/02
   
    Dim myOutlook As Object
    Dim myMailItem As Object
    On Err GoTo endSendMail
    ' Make instance
    Set myOutlook = CreateObject("Outlook.Application")
    ' Make mail item
    Set myMailItem = myOutlook.CreateItem(0)
    ' Set recipient (internal mail)
    myMailItem.Recipients.Add REC$
    ' Set subject
    myMailItem.Subject = SUBJ$
    ' Set body
    myMailItem.HTMLBody = BODY$
    ' And send it!
    myMailItem.Send
    ' Close instance
    Set myOutlook = Nothing
    Exit Sub
endSendMail:
    MsgBox Error & vbNewLine & "Mail Was Not Sent!"
End Sub

if not outlook, then there are several ways to do it... mayb one way would be to insert an SMTP server into your program, kick start the mail server and use it to send the data to your address, you could possibly (you could also run an SMTP server from your house and use that one) , etc... again- there are many ways to go about this... give us a lil more info (and what kind of re$ources do you have?)
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

Author Comment

by:enigrini
ID: 8033441
I have textboxes and listboxes on the form.  I'm not 100% sure how to get the form to send me an email when the user submit it.  The user can use outlook or Exchange - there is no way of knowing what the users are using.

Thanks.
0
 
LVL 18

Expert Comment

by:Sethi
ID: 8033848
Have you downloaded vbSendMail DLL? If yes then register that DLL in your computer using regsvr32 "Path of the DLL" through Run Command.

After registering the DLL run the project example supplied with the DLL.

Now look into the code of the project example. What exactly you will be doing is that instead of giving an interface to the user, when the user clicks a command button on your form, the object of this dll will be created and will send the information you require to you.

In all the above methods remember one thing: the user will know that some information is being sent from the PC. There is no way you can hide it from the user. So if you have any such ideas, drop it.
0
 

Author Comment

by:enigrini
ID: 8040189
When I run my program I get the following error - can somebody maybe tell me what it means?

Compile error: User-dedined type not defined
& when you click on the help button - The msdn collection does not exist.

Thanks.
0
 

Author Comment

by:enigrini
ID: 8040348
tampabay420

I tried your code and it worked.  But what do I do if somebody uses exchange??
0
 

Author Comment

by:enigrini
ID: 8040829
tampabay420

I tried your code and it worked.  But what do I do if somebody uses exchange??
0
 

Expert Comment

by:CleanupPing
ID: 8947111
enigrini:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
Experts: Post your closing recommendations!  Who deserves points here?
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 8983666
enigrini, an EE Moderator will handle this for you.
Moderator, my recommended disposition is:

    Refund points and save as a 0-pt PAQ.

DanRollins -- EE database cleanup volunteer
0
 

Accepted Solution

by:
YensidMod earned 0 total points
ID: 9104675
Question is PAQ'd and points refunded.

YensidMod
Community Support Moderator @Experts Exchange
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

770 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