473,320 Members | 2,054 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Send outlook emails vb.net

How can I send emails from my Microsoft Outlook through my code.
Dim OlApp As Outlook.Application doesn't even work for me. Any help will be appreciated.
Oct 29 '10 #1
1 2081
You can try something like:

Expand|Select|Wrap|Line Numbers
  1.  
  2. Private Sub Email_Click(ByVal strRecipient As String, ByVal strSubject As String, ByVal strMessageBody As String) 
  3.     Dim oOLApp As New Outlook.Application
  4.     Dim oNameSpace As Outlook.NameSpace
  5.     Dim oMAPIFolder As Outlook.MAPIFolder
  6.     Dim oMailMsg As Outlook.MailItem
  7.     oNameSpace = oOLApp.GetNamespace(Type:="MAPI")
  8.     oMailMsg = oOLApp.CreateItem(Outlook.OlItemType.olMailItem)
  9.     oMAPIFolder = oNameSpace.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderInbox)
  10.  
  11.     With oMailMsg
  12.         .Recipients.Add(strRecipient)
  13.         .Subject = strSubject
  14.         .Body = strMessageBody
  15.         .Display()
  16.     End With
  17. End Sub
  18.  
Nov 8 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Akira | last post by:
Could someone tell me how to send outlook appointment email from asp page? I would like appointment email just like one outlook can send out. I tried to look for an answer for this, but it seems...
6
by: Bob Alston | last post by:
I am using the Outlook library to send emails from Access. I have Outlook open and run a program to respond yes to the security question (Express click Yes). It seems to take about 5 seconds...
6
by: Nak | last post by:
Hi there, I'm currently using Outlook to send email in a VB.NET app but I would like more control over which email address the email is sent from. Is it possible to enumerate the available...
16
by: Kosmos | last post by:
Good afternoon everyone, just wondering if anyone knew if it's possible to send meetings or appointments through email when you run VBA or SQL code in Access 2003? The following is the code I've been...
1
by: shubhrarustagi | last post by:
hi, I'm a beginner developer and one of my first tasks is to develop automatic emails application in .net. We need to send automatic emails to users whose credit cards are expiring, create email...
0
by: guy | last post by:
I was wondering whether SteveMoren was able to send Outlook task using ASP.NET? If so, could he provide the code. That would be greatly appreciated. EggHeadCafe.com - .NET Developer Portal of...
0
by: =?Utf-8?B?am9lbA==?= | last post by:
When I posted a comment, I received a message that you had tried 3 times to send me emails but had been unable to do so. You asked me to solve this problem. How do I solve this problem? -- joel
1
by: prasath1984 | last post by:
hi, This is prasath i want the code to send bulk emails
2
by: techsri | last post by:
Hi, We are going to launch a website which offers free e-learning courses to the users. we are facing some problems to build my site. The problem is about, We want add push email feature to our...
11
by: londres9b | last post by:
I want to send multiple emails from php with one unique script. The emails are from a mysql database table. How can I achieve this?
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.