473,785 Members | 3,157 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to send a picture with outlook via access

Hi
I am using following code to send email
How can I use the .body or .htmlbody to insert a picture in the body of
ms outlook.
Outlook makes provision for sending pictures. If you are in the body you
click on insert and the picture option is then available. Thus I suppose you
can also do it via code
Thanks for help
Alfred


Dim olApp As Outlook.Applica tion
Dim olMailMessage As Outlook.MailIte m
Dim olRecipient As Outlook.Recipie nt
Dim olAttach As Outlook.Attachm ent
Dim emailstring As String
Dim cn As ADODB.Connectio n
Dim rs As ADODB.Recordset
Set cn = New ADODB.Connectio n
Set cn = CurrentProject. Connection

Set rs = cn.Execute("SEL ECT DbGeneralEmail from DbMaster1 ")

Dim AttachmentPath As String
AttachmentPath = "c:\aa\customer s.txt"

emailstring = " "
' Do Until rs.EOF
' If Not IsNull(rs!DbGen eralEmail) Then
' emailstring = emailstring + rs!DbGeneralEma il + ";"
emailstring = emailstring + "aj*******@jakh gtm.co.za" + ";"
Set olApp = New Outlook.Applica tion
Set olMailMessage = olApp.CreateIte m(olMailItem)
With olMailMessage
.To = emailstring
.BCC = emailstring
.Display
.Subject = " tst subj " 'Me!txtSubject
.Body = Me!txtBody & vbCrLf & vbCrLf ''' want to insert
picture here or html file
.HTMLBody = p
' .Links

.Importance = olImportanceHig h 'High importance

If Not IsMissing(Attac hmentPath) Then
Set olAttach = .Attachments.Ad d(AttachmentPat h)
End If
.Send
End With
Set olMailMessage = Nothing
emailstring = " "
' End If
' rs.MoveNext
' Loop

End Sub
Nov 13 '05 #1
0 1732

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
12091
by: Google Mike | last post by:
I've got RH9 Linux with default PHP. Is there a way to send email on Linux to an Exchange Server from PHP and/or other tools when there is *NOT* SMTP access? Has anyone figured out a way to use PHP to get inside an OWA (Microsoft Outlook Web Access) website to send email that way? The reason I ask is because my corporate office is going to do away with our rogue SMTP server access and force everything through Exchange
0
3711
by: David Burson | last post by:
Hi, I have a VB.NET windows app that needs to automatically send a simple text email when my users run a new version of the app for the first time. I thought this would be simple, but after days of reading posts and testing, I see it is not - unless I'm missing something? I'm not an email guru. All of my users will be running at least Windows 2000, most on XP sp2. Some of my users will have Outlook, many will be using Outlook...
1
5345
by: Jay McGrath | last post by:
Help - trying to send a simple text email with with as little user intervention. I am trying to create a button in my Access application that will automatically send a simple text email. It works except that I have two warning nuisances: 1) Program is trying to access email Addresses you have stored in Outlook. Allow access for ... 2) A program is trying to automatically send email on your behalf ... Heck, I am only trying to a send...
3
1343
by: Christian Hamel | last post by:
As said in the topic? I understand that this security has been added following many viruses out there but we have an automated system that we need to put in place that send emails. Any idea? Thanks
10
24394
by: Mike Charney | last post by:
Is there a simple way to send SMTP email from Access VBA? Mike m charney at dunlap hospital dot org
16
7077
by: anya | last post by:
Hey, I have a certain problem and till now I didnt find an answer on the web. I want to send an email message with picture in it. I dont want to put it as attachment but make it in the body of the mail, so every one who open the email will see the picture.. (it is possible that the solution will be in any other format that will be opened i.e pdf, doc and I will put this in the body )
17
7648
by: rdemyan | last post by:
My app creates a building report. My users have requested that I provide functionality to e-mail these "building reports" to building managers once a month. So assuming that I have the following table that lists a building manager's name, e-mail address and their building, is there a way that I can automate this to send these monthly e-mails from Outlook. Ideally this would be a click one button type of action:
16
6200
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 using which sends If you want to see the above code in its full context you can see it here: http://www.thescripts.com/forum/thread581521.html Willakawill helped me out a bit with getting access to remember if it had already added the...
1
2843
by: pixie | last post by:
Hi. Access 2003. The database stores contract information. I have a query for each person that is responsible for contracts. The query checks to see if there are reports due either this week, next week, or in three week. A report is created for each query but if the report has no data, it is not saved. I have a button on a form that will run code to automatically send each person their own report. If a person doesn't have a report, the...
0
9645
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9480
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
10325
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...
1
10091
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
9950
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8972
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
4053
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
3646
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2879
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.