473,883 Members | 1,718 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How can I Send E-Mail from an Access Table using MS Outlook

12 New Member
I am running access 2010. I have a table with email address' as one of the fields. I want to send the same message to all or some of my contacts. The table is named Donors and the field is Email address. I am using outlook express for my e-mail.
Jan 30 '12 #1
29 7867
NeoPa
32,584 Recognized Expert Moderator MVP
Outlook Express is not an MS Office application, and as such is not likely to fall within the experience range of most of our experts.

Application Automation may help some, but that's as far as I can go with the Outlook Express part I'm afraid.
Jan 30 '12 #2
Hogue
12 New Member
NeoPa, my email is through outlook. If this is not able to work with access what other options do I have.

Thanks for any help
Jan 31 '12 #3
NeoPa
32,584 Recognized Expert Moderator MVP
Outlook is well set up to be controlled from within Access. Your question title indicates you're using Outlook Express though. This new post is a contradiction of that so you won't be surprised to find we're somewhat confused at this point.

Please clarify before continuing.
Jan 31 '12 #4
ADezii
8,834 Recognized Expert Expert
The Logic would be as follows, any questions feel free to ask.
Expand|Select|Wrap|Line Numbers
  1. Dim oLook As Object
  2. Dim oMail As Object
  3. Dim olns As Outlook.NameSpace
  4. Dim strTO As String
  5. Dim strMessageBody As String
  6. Dim strSubject As String
  7. Dim MyDB As DAO.Database
  8. Dim rst As DAO.Recordset
  9.  
  10. 'Do you even have E-Mail Addressess in the Donors Table?
  11. '[E-Mail Address] cannot be NULL
  12. If DCount("[E-Mail Address]", "Donors") = 0 Then Exit Sub
  13.  
  14. Set MyDB = CurrentDb
  15. Set rst = MyDB.OpenRecordset("Donors", dbOpenSnapshot, dbOpenForwardOnly)
  16.  
  17. Set oLook = CreateObject("Outlook.Application")
  18. Set olns = oLook.GetNamespace("MAPI")
  19. Set oMail = oLook.CreateItem(0)
  20.  
  21. 'Build the Recipient List
  22. With rst
  23.   Do While Not .EOF
  24.     strTO = strTO & ![E-Mail Address] & ";"
  25.       .MoveNext
  26.   Loop
  27. End With
  28.  
  29. 'Remove Trailing ';'
  30. strTO = Left$(strTO, Len(strTO) - 1)
  31.  
  32. '******************************* USER DEFINED SECTION ********************************
  33. strMessageBody = "Message to ALL Recipients       "
  34. strSubject = "Test Project for E-Mailing Multiple Recipients in Outlook"
  35. '*************************************************************************************
  36.  
  37. With oMail
  38.  .To = strTO
  39.  .Body = strMessageBody
  40.  .Subject = strSubject
  41.    '.Display
  42.      .Send      'Immediately Sends the E-Mail without displaying Outlook
  43. End With
  44.  
  45. Set oMail = Nothing
  46. Set oLook = Nothing
  47.  
  48. rst.Close
  49. Set rst = Nothing
Jan 31 '12 #5
Hogue
12 New Member
Sorry, my mail is through Outlook, not Outlook express.

The table is Donors and the field is E-Mail address

Thanks again and sorry for the misinformation
Jan 31 '12 #6
Hogue
12 New Member
Will try ADezzi Thanks.

ADezii, can I run this code through a Macro or should I copy it into a module and run the module from a Macro?
Jan 31 '12 #7
ADezii
8,834 Recognized Expert Expert
What context do you need to run it in?
Jan 31 '12 #8
Hogue
12 New Member
What I will be doing is sending a message to all listed email address'. One message to all either in a query from the donors table or the donors table itself
Jan 31 '12 #9
NeoPa
32,584 Recognized Expert Moderator MVP
Hogue:
Sorry, my mail is through Outlook, not Outlook express.
Right. With that cleared up (I've updated the thread title for you) I can probably leave you in ADezii's capable hands. He's a dab-hand at Outlook automation from Access. I'll keep an eye on this though, in case I can help at any stage.
Feb 1 '12 #10

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

Similar topics

2
19924
by: Tom Brown | last post by:
Hi, I have what seems to be a simple problem. But I can not for the life of me find a way to send an integer over a socket. The send method will only accept strings. Here is what I am trying to do: testmessage = 'test message' msglen = len(testmessage) sock.send(msglen) sock.send(testmessage)
0
1689
by: Piotr Bieniek | last post by:
Hello, I have a problem with UDP sockets. It concerns UdpClient class as well. It throws strange exceptions on subsequent Send calls. Exception is SocketException with native error code 10049. I noticed that it happens when I call Send for the second time in my program. It seemed strange, so I compiled and run Chat sample program from MSDN. To my surprise, it worked. But then I modified it. The only change was that I duplicated sending...
9
3171
by: eswanson | last post by:
I have a web page I need to post a file plus some other fields to it. How can I do this from a asp.net page. I know I can send individual fields to the other page, but how do I send a file to the other page, or is there something else like a stream which will be like a file. I am attempting to get a way from writing out a file and then having to give the page that I am posting to the file name. Instead I would like to just from asp.net...
0
1284
by: Markus Poehler | last post by:
Hi there! I have created NT Service that runs on a Server. It should NET SEND to a specifiv Client in a special case of environment. It does NOT net send. The Messenger Service is running. Manually executed in DOS net send works from server. I have created a 2nd NT SRV to test it that does nothing else then sending net send onStart and installed it on the server. That net send
1
15684
by: charlies224 | last post by:
Hi, I am writting a software that requires me to make sure the Num Lock is always on and Caps Lock is always off. First, I know how to detect if Num Lock or Caps Lock is on or off (if someone is interested, let me know and I will send you the codes). Once we know if the stat of Num Lock/ Caps Lock is not what we desired, we just send the Num Lock / Caps Lock key to change the stat. From most of
2
4192
by: eSolTec, Inc. 501(c)(3) | last post by:
I'm looking for code samples to send a jpg image from a client machine to a host machine. Both have the same image picWindows picture container. I would like to be able to send the image on one machine to another machine as close to realtime as possible. Also, can someone point me a direction to find out how to transmit various field of information, i.e. listboxview, listbox, textbox, datagridview etc via .NET remoting. Everything I've...
11
2682
by: Phil Hunt | last post by:
I am porting an VB6 program to .NET C# There is a NET SEND command in the VB6 program. Just wondering if there is any thing similar in the framework. Thanks.
4
10443
by: gvijayaratnam | last post by:
Hi All, I have a fn prototype as follows void print ( char *Buffer, usigned long bufferSize, int chunkSize ); This fn will accept binary file buffer and the buffer size and the chunk size, implementation must be open socket and send the buffer in chunks which is provided by the parameter.
2
1557
by: SvenV | last post by:
I based my program on the asynchronous client/server example on msdn. There weren't too many modifications to the original code. I just created some extra code to response to different messages. F.e. when I send GETARTICLES<EOF> it gets the articles from the DB and when I send something else it does that specific task. That all works fine. The problem is when I connect to the server and I try to send 2 commands after another. F.e. First get the...
7
2889
by: Thomas Mlynarczyk | last post by:
Hello, I was playing around a bit with generators using next() and send(). And I was wondering why an extra send() method was introduced instead of simply allowing an argument for next(). Also, I find it a bit counter-intuitive that send(42) not only "sets" the generator to the specified value, but yields the next value at the same time.
0
9777
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11109
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10726
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10833
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9558
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7957
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7114
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4602
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4198
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.