473,573 Members | 2,860 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Repost: Attachments to Outlook Express possible?

Hi all,

This is a repost of a message posted at october 6.
The answer I got was about MapiMessages.At tachmentIndex.
I think I need the MSMAPI32.OCX to use this. (I don't have this file on my PC)

My newsaccount wasn't working anymore until yesterday, so I'll try again.

Question is:
I know it is possible to send email with Access, but can one also automate the attachments?
Question has been asked a lot I know...
I've searched Google but *all* answers that work use Outlook or commercial apps?
So I have not been able yet to automate the attachment-issue using Outlook Express.
Any ideas or 'new' insight?
(Using Access '97 or Access 2000)

TIA
Arno R

Nov 12 '05 #1
12 4709
Arno,
did you look on Tony Toews'site in the e-mail section? I'm almost
positive it's all covered there.

http://www.granite.ab.ca/access/email.htm
Nov 12 '05 #2
"Arno R" <ar************ ****@tiscali.nl > wrote in
news:3f******** ************@dr eader2.news.tis cali.nl:
Hi all,

This is a repost of a message posted at october 6.
The answer I got was about MapiMessages.At tachmentIndex.
I think I need the MSMAPI32.OCX to use this. (I don't have this file on
my PC)

My newsaccount wasn't working anymore until yesterday, so I'll try
again.

Question is:
I know it is possible to send email with Access, but can one also
automate the attachments? Question has been asked a lot I know...
I've searched Google but *all* answers that work use Outlook or
commercial apps? So I have not been able yet to automate the
attachment-issue using Outlook Express. Any ideas or 'new' insight?
(Using Access '97 or Access 2000)

TIA
Arno R


This class should send attachments via Outlook Express. But WHY? CDO is
much simpler and much stronger.

Option Explicit

Private Type MAPIRecip
Reserved As Long
RecipClass As Long
Name As String
Address As String
EIDSize As Long
EntryID As String
End Type

Private Type MAPIFileTag
Reserved As Long
TagLength As Long
Tag() As Byte
EncodingLength As Long
Encoding() As Byte
End Type

Private Type MAPIFile
Reserved As Long
Flags As Long
Position As Long
PathName As String
FileName As String
FileType As Long
End Type

Private Type MAPIMessage
Reserved As Long
Subject As String
NoteText As String
MessageType As String
DateReceived As String
ConversationID As String
Originator As Long
Flags As Long
RecipCount As Long
Recipients As Long
FileCount As Long
Files As Long
End Type

Private Declare Function MAPISendMail _
Lib "c:\program files\outlook express\msoe.dl l" ( _
ByVal Session As Long, _
ByVal UIParam As Long, _
ByRef message As MAPIMessage, _
ByVal Flags As Long, _
ByVal Reserved As Long) As Long

Private Const MAPI_E_NO_LIBRA RY = 999
Private Const MAPI_E_INVALID_ PARAMETER = 998

Private Const MAPI_ORIG = 0
Private Const MAPI_TO = 1
Private Const MAPI_CC = 2
Private Const MAPI_BCC = 3

Private Const MAPI_UNREAD = 1
Private Const MAPI_RECEIPT_RE QUESTED = 2
Private Const MAPI_SENT = 4

Private Const MAPI_LOGON_UI = &H1
Private Const MAPI_NEW_SESSIO N = &H2
Private Const MAPI_DIALOG = &H8
Private Const MAPI_UNREAD_ONL Y = &H20
Private Const MAPI_ENVELOPE_O NLY = &H40
Private Const MAPI_PEEK = &H80
Private Const MAPI_GUARANTEE_ FIFO = &H100
Private Const MAPI_BODY_AS_FI LE = &H200
Private Const MAPI_AB_NOMODIF Y = &H400
Private Const MAPI_SUPPRESS_A TTAch = &H800
Private Const MAPI_FORCE_DOWN LOAD = &H1000

Private Const MAPI_OLE = &H1
Private Const MAPI_OLE_STATIC = &H2
Dim mAf() As MAPIFile
Dim mAr() As MAPIRecip
Dim lAr As Long
Dim lAf As Long
Dim mM As MAPIMessage
Dim aErrors(0 To 26) As String

Private Sub Class_Initializ e()
aErrors(0) = "Success"
aErrors(1) = "User Abort"
aErrors(2) = "Failure"
aErrors(3) = "LogIn Failure"
aErrors(4) = "Disk Full"
aErrors(5) = "Insufficie nt Memory"
aErrors(6) = "Block Too Small"
aErrors(8) = "Too Many Sessions"
aErrors(9) = "Too Many Files"
aErrors(10) = "Too Many Recipients"
aErrors(11) = "Attachment No Found"
aErrors(12) = "Attachment Open Failure"
aErrors(13) = "Attachment Write Failure"
aErrors(14) = "Unknown Recipient"
aErrors(15) = "Bad Recipient"
aErrors(16) = "No Messages"
aErrors(17) = "Invalid Message"
aErrors(18) = "Text Too Large"
aErrors(19) = "Invalid Session"
aErrors(20) = "Type Not Suppported"
aErrors(21) = "Ambiguous Recipient"
aErrors(22) = "Message in Use"
aErrors(23) = "Network Failure"
aErrors(24) = "Invalid Edit Fields"
aErrors(25) = "Invalid Recipient"
aErrors(26) = "Not Supported"
End Sub

Public Sub BCCAddressAdd(B yVal strAddress As String)
RecipientAdd MAPI_BCC, , strAddress
End Sub

Public Sub BCCNameAdd(ByVa l strName As String)
RecipientAdd MAPI_BCC, strName
End Sub

Public Sub CCAddressAdd(By Val strAddress As String)
RecipientAdd MAPI_CC, , strAddress
End Sub

Public Sub CCNameAdd(ByVal strName As String)
RecipientAdd MAPI_CC, strName
End Sub

Public Sub MessageIs(ByVal strNoteText As String)
mM.NoteText = strNoteText
End Sub

Public Sub SubjectIs(ByVal strSubject As String)
mM.Subject = strSubject
End Sub

Public Sub ToAddressAdd(By Val strAddress As String)
RecipientAdd MAPI_TO, , strAddress
End Sub

Public Sub ToNameAdd(ByVal strName As String)
RecipientAdd MAPI_TO, strName
End Sub

Public Sub FileAdd(ByVal strPathName As String)
Dim f As MAPIFile
With f
.PathName = StrConv(strPath Name, vbFromUnicode)
End With
ReDim Preserve mAf(lAf)
mAf(lAf) = f
lAf = lAf + 1
End Sub

Public Sub Send()
Dim r As Long
With mM
If lAf > 0 Then
.FileCount = lAf
.Files = VarPtr(mAf(0))
End If
If lAr > 0 Then
.RecipCount = lAr
.Recipients = VarPtr(mAr(0))
r = MAPISendMail(0, 0, mM, 0, 0)
If r <> 0 Then MsgBox aErrors(r)
End If
End With
End Sub

Private Sub RecipientAdd(By Val lngType As Long, _
Optional ByVal strName As String, Optional ByVal strAddress As String)
Dim r As MAPIRecip
r.RecipClass = lngType
If strName <> "" Then r.Name = StrConv(strName , vbFromUnicode)
If strAddress <> "" Then r.Address = StrConv(strAddr ess,
vbFromUnicode) ReDim Preserve mAr(lAr)
mAr(lAr) = r
lAr = lAr + 1
End Sub
--
Lyle
(for e-mail refer to http://ffdba.com/contacts.htm)
Nov 12 '05 #3
Hi Pieter, thanks for replying.

(Again my newsserver is not working @#$%@##$$
so I created a Google-account to reply)

I did search and looked (more than once) on Tony's site. Good stuff
and good info but not exactly on the topic I need.
Maybe I misread or overlooked, but I only found examples including
attachments that used Outlook (not Outlook Express)or it was third
party vendor stuff.
What I am looking for is a way to automate emails with and without
attachments that will *always* work with my clients.
I prefer not to use ocx-controls or dll's that might not be present at
my client's computers.

Arno R

pi********@hotm ail.com (Pieter Linden) wrote in message news:<bf******* *************** ****@posting.go ogle.com>...
Arno,
did you look on Tony Toews'site in the e-mail section? I'm almost
positive it's all covered there.

http://www.granite.ab.ca/access/email.htm

Nov 12 '05 #4
Hi Lyle,
This class should send attachments via Outlook Express. But WHY? CDO is
much simpler and much stronger.

I need info for OE because not all of my clients will have the
CDO-library installed.
Or am I missing something obvious here?

Thanks very much for the info but, could you explain a bit more on how
to use this code please?
I guess I start with initializing the class but this immediately
errors?

TIA
Arno R
Nov 12 '05 #5
ar*****@tiscali .nl (Arno R) wrote in news:7599ce12.0 310230414.34a5a 665
@posting.google .com:
Hi Lyle,
This class should send attachments via Outlook Express. But WHY? CDO is
much simpler and much stronger.

I need info for OE because not all of my clients will have the
CDO-library installed.
Or am I missing something obvious here?

Thanks very much for the info but, could you explain a bit more on how
to use this code please?
I guess I start with initializing the class but this immediately
errors?


Should I guess what these errors are?

--
Lyle
(for e-mail refer to http://ffdba.com/contacts.htm)
Nov 12 '05 #6
Hi Pieter, thanks for replying.

I did search and looked (more than once) on Tony's site. Good stuff and good info but not exactly on
the topic I need.
Maybe I misread or overlooked, but I only found examples including attachments that used Outlook
(not Outlook Express)
or it was third party vendor stuff.
What I am looking for is a way to automate emails with and without attachments that will *always*
work with my clients.
I prefer not to use ocx-controls or dll's that might not be present at my client's computers.

"Pieter Linden" <pi********@hot mail.com> schreef in bericht
news:bf******** *************** ***@posting.goo gle.com...
Arno,
did you look on Tony Toews'site in the e-mail section? I'm almost
positive it's all covered there.

http://www.granite.ab.ca/access/email.htm


Nov 12 '05 #7
Lyle, I am not waiting for such a 'guess'.
What I need is an answer that I understand.

If I ask stupid questions allright, let me know, but I still would appreciate if you help me out on
this.

Arno R
"Lyle Fairfield" <Mi************ @Invalid.Com> schreef in bericht
news:Xn******** ***********@130 .133.1.4...
ar*****@tiscali .nl (Arno R) wrote in news:7599ce12.0 310230414.34a5a 665
@posting.google .com:
Hi Lyle,
This class should send attachments via Outlook Express. But WHY? CDO is
much simpler and much stronger.

I need info for OE because not all of my clients will have the
CDO-library installed.
Or am I missing something obvious here?

Thanks very much for the info but, could you explain a bit more on how
to use this code please?
I guess I start with initializing the class but this immediately
errors?


Should I guess what these errors are?

--
Lyle
(for e-mail refer to http://ffdba.com/contacts.htm)

Nov 12 '05 #8
I guess I start with initializing the class but this immediately
errors?
Should I guess what these errors are?

Lyle would like to know what error you are referring to. I believe it's
because of some line wraps at wrong positions:
Private Sub RecipientAdd(By Val lngType As Long, _ ...
...
If strAddress <> "" Then r.Address = StrConv(strAddr ess,
vbFromUnicode) ReDim Preserve mAr(lAr)


should read:

If strAddress <> "" Then r.Address = _
StrConv(strAddr ess, vbFromUnicode)
ReDim Preserve mAr(lAr)
HTH - Peter

--
No mails please.
Nov 12 '05 #9
"Arno R" wrote
Lyle, I am not waiting for such a 'guess'.
What I need is an answer that I understand.

If I ask stupid questions allright, let me
know, but I still would appreciate if you
help me out on this.


Lyle and I have disagreed on many issues, but I agree with him on this one.
If you want help, you have to describe the problem in detail and with care.
Precise and concise questions are the ones most likely to be answered. Don't
whine when someone helping you asks for information, even if you think that
person is being "snippy".

A perfectly understandable response to a whine in reply to a request for
information needed to help someone is no response at all. However, it would
likely be worth your while to provide the specific information he asked
about. He might then be able to help, or someone else might.

Larry Linson
Nov 12 '05 #10

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

Similar topics

0
5923
by: John P | last post by:
Hello, I'm building email messages and attachments via the JavaMail API, which are then sent via sendmail. The attachments are mime attachments of type "application/octet-stream". They are received via fine via lotus notes and outlook, but in outlook express, yahoo, and hotmail the attachment does not appear. Yahoo will even report the...
3
2406
by: AspDotNetDeveloper | last post by:
I'm trying to troubleshoot why my ASP application can no longer send file attachments larger than 100K, and I have eliminated many possibilities already, but I'm running out of ideas. I think I have it narrowed down to an Outlook Express update that is installed on the Win 2K Server, but when I try to remove the update, then the application...
2
1940
by: Arno R | last post by:
Hi all, I know it is possible to send email with Access, but can one also automate the attachments? Question has been asked a lot I know... I've searched Google but *all* answers that work use Outlook or commercial apps? So I have not been able yet to automate the attachment issue using Outlook Express. Any ideas or 'new' insight? (Using...
5
15921
by: paii, Ron | last post by:
How do I setup a email with attachment for preview but require the user to push the SEND button in Outlook. I have the following function but it sends the email without the sender ever seeing it. Public Function PrintPDFemail2() ' This will create the PDF if the report is setup for it DoCmd.OpenReport "rptJobItemStat", acViewNormal
6
13273
by: A.M-SG | last post by:
Hi, I have an aspx page at the web server that provides PDF documents for smart client applications. Here is the code in aspx page that defines content type: Response.ContentType = "application/octet-stream"; Response.AppendHeader("Content-Disposition", "attachment;filename=" + fileID.ToString() + ".pdf");
14
2816
by: Steve McLellan | last post by:
Hi, Sorry to repost, but this is becoming aggravating, and causing me a lot of wasted time. I've got a reasonably large mixed C++ project, and after a number of builds (but not a constant number) linking (and sometimes compiling) becomes immensely slow, and task manager shows that link.exe (or cl.exe) is barely using any processor time, but...
5
2426
by: Adrian Parker | last post by:
I've got the standard SqlCacheDependency working just fine , ie. I've defined (and encrypted) the connectionStrings section in the web.config, and I've also defined an an sqlCacheDependency in the caching section. So, in my code I add an item to the cache with an sqlCacheDependency, referencing the named sqlCacheDependency in the web.config...
0
1009
by: DC | last post by:
I have a requirement for an application that, through drag and drop, takes the email attachments from Outlook 2000 desktop clients and sends them in binary format to a SQL Server database. At this point its a POC app, so I am being encouraged to keep it simple. I figure I could use a Webservice and SOAP for this, or perhaps a Windows...
1
1380
by: =?Utf-8?B?U2VyZW5h?= | last post by:
For some reason .jpg attachments, infact any attachments in outlook express have all of a sudden decieded to take ages to open but if saved on the hard disc they open in a flash. i use Windows XP Pro, Outlook Express 6, Office 2003, i have searched the net for anyone that might have similar problems but only came up with someone that had the...
0
7767
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...
0
7684
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...
0
8006
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. ...
0
8058
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...
0
5288
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...
0
3729
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2191
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
1
1295
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1035
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...

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.