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

Sending EMAIL from Visual Basic Code

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
rockzZ101
Asked:
rockzZ101
  • 2
  • 2
1 Solution
 
shendr8086Commented:
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
 
unknown_routineCommented:
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
 
shendr8086Commented:
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
 
maxmaiCommented:
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
 
unknown_routineCommented:
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

Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

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