Solved

Sending EMAIL from Visual Basic Code

Posted on 2004-03-24
8
185 Views
Last Modified: 2013-11-25
Hi,
  I want to send an email to the user directly form my vb form by pressing a button.

Secondly i am using a datagrid with adodc1 to retrieve some records from the patient table. However i want only to retrieve records for a sinlge patient by pressing a serach button and only a particular patient records should be displayed on the grid but currently i am getting all patients the records being retrieved from the table. I have used select query at design mode and all setting are made in the design mode. I have tried to put the adodc1 and datagrid code and the query behind the search button but then i get errors.

For example if i say

datagrid1.recordsource=adodc1  <--- it gives an error.

Anyone have any ideas
0
Comment
Question by:rockzZ101
  • 2
  • 2
8 Comments
 
LVL 1

Accepted Solution

by:
shendr8086 earned 20 total points
ID: 10670602
For the email you will need to put a MAPI control on yur form or include a reference to Outlook and use the Outllook object. THe MSDN site can help you with this.
0
 
LVL 15

Expert Comment

by:unknown_routine
ID: 10671778
Hi,
here is a nice and simple tutorail on how to send email using VB.

http://www.devarticles.com/c/a/Visual-Basic/Sending-Email-With-MAPI-Components-in-Visual-Basic/
0
 
LVL 1

Expert Comment

by:shendr8086
ID: 10671926
You can use this once you set a reference to Outlook in the IDE:

    Set olApp = CreateObject("Outlook.Application")
    Set olns = olApp.GetNamespace("MAPI")
    Set olMail = olApp.CreateItem(olMailItem)
    olns.Logon
    olMail.To = Address
    olMail.Subject = Subject
    olMail.Body = Body
    olMail.Send
    olns.Logoff
   
    Set olns = Nothing
    Set olMail = Nothing
    Set olApp = Nothing
0
 

Expert Comment

by:maxmai
ID: 10676397
Hi,
you can use JMail component. It's free and very easy to use.

Can be downloaded from

http://www.dimac.net/FreeDownloads/dlstart.asp?ProductID=5

0
 
LVL 15

Expert Comment

by:unknown_routine
ID: 11258012
rockzZ101: has recieved complte answer to 1st part of his question.

A split and with grade B or C seems proper.

Regards.
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
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 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 is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

825 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