Attachments are lost or cannot be read

  • Thread starter Thread starter abc
  • Start date Start date
A

abc

Hi,

We are using an Access application with a mail function. We create a new
mail from within the Access application, then manually add an attachment
and send the mail to an external recipient. When the mail is received, the
name of the attachment has changed, i.e. attachment21 (with no extension).
The contents of the attachment cannot be read by any program, as far as I
know.
If we create the same mail from within Outlook and add the same attachment,
everything works as expected.
We are using Outlook 98 (8.5.5104.6), Access 97 (SR-2) and Exchange 5.5
(Build 2650.24: Service pack 3)

Any ideas of how to isolate this problem are appreciated.

This is the code we are using in the Access application:

Sub SendMessage(DisplayMsg As Boolean, strRecipient As String, Optional
varDisplay As Variant)
On Error GoTo Err_SendMessage
Dim objOutlook As outlook.Application
Dim objOutlookMsg As outlook.MailItem
Dim objOutlookRecip As outlook.Recipient
Dim objOutlookAttach As outlook.Attachment
Dim objOutlookContact As outlook.ContactItem
Dim objFolder As Object
Dim nsOutlook As outlook.NameSpace
Dim objAddress As outlook.AddressList
Dim objEntry As outlook.AddressEntry
Dim i As Integer

Set objOutlook = CreateObject("Outlook.Application")
Set nsOutlook = objOutlook.GetNamespace("MAPI")
nsOutlook.Logon
Set objOutlookMsg = objOutlook.CreateItem(olMailItem)
With objOutlookMsg
If IsMissing(varDisplay) = True Then
Set objOutlookRecip = .Recipients.Add(strRecipient)
Else
Set objOutlookRecip = .Recipients.Add(varDisplay)
End If
objOutlookRecip.type = olTo
For Each objOutlookRecip In .Recipients
objOutlookRecip.Resolve
Next
If DisplayMsg = True Then
.Display
Else
.Send
End If
End With
Set objOutlook = Nothing

Exit_SendMessage:
Exit Sub

Err_SendMessage:
MsgBox Err.Description, vbExclamation, "Send message"
Resume Exit_SendMessage
End Sub
 
Your code doesn't show how you are adding the attachments, so it is difficult
to say what the problem could be.
 
When the mail is shown, the user manually adds an attachment. Just like you
normally add an attachment to a mail with the mouse.
 
Sorry, I just noticed that you did say the attachments were being added
manually. I can't see how Access or Outlook could effect any changes to the
attachment name. My guess is that the Windows option to "hide extensions for
known file types" might be enabled, thus you won't see the attachment
extension in the e-mail message.

I just tried toggling this option, and although the extensions were hidden
in Windows, they were still visible in Outlook even after I shut it down and
relaunched it. Perhaps they'll hide in Outlook after an OS reboot;
otherwise, I have no clue.
 
Sorry, maybe I havent explained the problem clear enough...
When the user adds the attachment, everything is still OK. The mail is then
being sent (to an external recipient) and the user assumes that the mail
arrives well.
When the recipient reads the mail there are two possibilities:
1 When the mail was sent directly from within Outlook, the recipient sees
the attachment with the right name and the attachment can be read.
2 When the mail was sent from within Access, the recipient sees an
attachment with the name "attachment21" and the attachment cannot be read.

The problem has something to do with Exchange. Everything works fine as long
as the outbound attachments in Exchange have been set to UUENCODE with
binhex turned on. However, we would like to add a disclaimer text to all
outgoing mail. This disclaimer must be added in rich text format. Therefore
it is neccesary to send mails in MIME format using HTML.
When we change the outbound attachments to MIME format, then the attachment
problem occurs.
The settings for Exchange can be found in Exchange Administrator:
<Domain> - Connections - Internet Mail Service - Properties - Internet Mail
Tab

To my opinion the problem should be solved by changing a property in
Exchange/Outlook and/or rewriting the code to create the mail exactly the
same way Outlook does.


Eric Legault said:
Sorry, I just noticed that you did say the attachments were being added
manually. I can't see how Access or Outlook could effect any changes to the
attachment name. My guess is that the Windows option to "hide extensions for
known file types" might be enabled, thus you won't see the attachment
extension in the e-mail message.

I just tried toggling this option, and although the extensions were hidden
in Windows, they were still visible in Outlook even after I shut it down and
relaunched it. Perhaps they'll hide in Outlook after an OS reboot;
otherwise, I have no clue.

--
Eric Legault - B.A, MCP, MCSD, Outlook MVP
--------------------------------------------------
{Private e-mails ignored}
Job: http://www.imaginets.com
Blog: http://blogs.officezealot.com/legault/

abc said:
When the mail is shown, the user manually adds an attachment. Just like you
normally add an attachment to a mail with the mouse.


"Eric Legault [MVP - Outlook]" <[email protected]> schreef in
bericht news:[email protected]...
Your code doesn't show how you are adding the attachments, so it is difficult
to say what the problem could be.

--
Eric Legault - B.A, MCP, MCSD, Outlook MVP
--------------------------------------------------
{Private e-mails ignored}
Job: http://www.imaginets.com
Blog: http://blogs.officezealot.com/legault/

:

Hi,

We are using an Access application with a mail function. We create a new
mail from within the Access application, then manually add an attachment
and send the mail to an external recipient. When the mail is
received,
the
name of the attachment has changed, i.e. attachment21 (with no extension).
The contents of the attachment cannot be read by any program, as far
as
I
know.
If we create the same mail from within Outlook and add the same attachment,
everything works as expected.
We are using Outlook 98 (8.5.5104.6), Access 97 (SR-2) and Exchange 5.5
(Build 2650.24: Service pack 3)

Any ideas of how to isolate this problem are appreciated.

This is the code we are using in the Access application:

Sub SendMessage(DisplayMsg As Boolean, strRecipient As String, Optional
varDisplay As Variant)
On Error GoTo Err_SendMessage
Dim objOutlook As outlook.Application
Dim objOutlookMsg As outlook.MailItem
Dim objOutlookRecip As outlook.Recipient
Dim objOutlookAttach As outlook.Attachment
Dim objOutlookContact As outlook.ContactItem
Dim objFolder As Object
Dim nsOutlook As outlook.NameSpace
Dim objAddress As outlook.AddressList
Dim objEntry As outlook.AddressEntry
Dim i As Integer

Set objOutlook = CreateObject("Outlook.Application")
Set nsOutlook = objOutlook.GetNamespace("MAPI")
nsOutlook.Logon
Set objOutlookMsg = objOutlook.CreateItem(olMailItem)
With objOutlookMsg
If IsMissing(varDisplay) = True Then
Set objOutlookRecip = .Recipients.Add(strRecipient)
Else
Set objOutlookRecip = .Recipients.Add(varDisplay)
End If
objOutlookRecip.type = olTo
For Each objOutlookRecip In .Recipients
objOutlookRecip.Resolve
Next
If DisplayMsg = True Then
.Display
Else
.Send
End If
End With
Set objOutlook = Nothing

Exit_SendMessage:
Exit Sub

Err_SendMessage:
MsgBox Err.Description, vbExclamation, "Send message"
Resume Exit_SendMessage
End Sub
 
Ah, okay. Sorry, I have no idea what could be happening. My eyes glaze over
as soon as I see anything about "MIME types". :-)

Are you using Access' SendMail method, or Outlook VBA within an Access
module? If the former, maybe it's the culprit. I'm just guessing now though.

--
Eric Legault - B.A, MCP, MCSD, Outlook MVP
--------------------------------------------------
{Private e-mails ignored}
Job: http://www.imaginets.com
Blog: http://blogs.officezealot.com/legault/


abc said:
Sorry, maybe I havent explained the problem clear enough...
When the user adds the attachment, everything is still OK. The mail is then
being sent (to an external recipient) and the user assumes that the mail
arrives well.
When the recipient reads the mail there are two possibilities:
1 When the mail was sent directly from within Outlook, the recipient sees
the attachment with the right name and the attachment can be read.
2 When the mail was sent from within Access, the recipient sees an
attachment with the name "attachment21" and the attachment cannot be read.

The problem has something to do with Exchange. Everything works fine as long
as the outbound attachments in Exchange have been set to UUENCODE with
binhex turned on. However, we would like to add a disclaimer text to all
outgoing mail. This disclaimer must be added in rich text format. Therefore
it is neccesary to send mails in MIME format using HTML.
When we change the outbound attachments to MIME format, then the attachment
problem occurs.
The settings for Exchange can be found in Exchange Administrator:
<Domain> - Connections - Internet Mail Service - Properties - Internet Mail
Tab

To my opinion the problem should be solved by changing a property in
Exchange/Outlook and/or rewriting the code to create the mail exactly the
same way Outlook does.


Eric Legault said:
Sorry, I just noticed that you did say the attachments were being added
manually. I can't see how Access or Outlook could effect any changes to the
attachment name. My guess is that the Windows option to "hide extensions for
known file types" might be enabled, thus you won't see the attachment
extension in the e-mail message.

I just tried toggling this option, and although the extensions were hidden
in Windows, they were still visible in Outlook even after I shut it down and
relaunched it. Perhaps they'll hide in Outlook after an OS reboot;
otherwise, I have no clue.

--
Eric Legault - B.A, MCP, MCSD, Outlook MVP
--------------------------------------------------
{Private e-mails ignored}
Job: http://www.imaginets.com
Blog: http://blogs.officezealot.com/legault/

abc said:
When the mail is shown, the user manually adds an attachment. Just like you
normally add an attachment to a mail with the mouse.


"Eric Legault [MVP - Outlook]" <[email protected]> schreef in
bericht Your code doesn't show how you are adding the attachments, so it is
difficult
to say what the problem could be.

--
Eric Legault - B.A, MCP, MCSD, Outlook MVP
--------------------------------------------------
{Private e-mails ignored}
Job: http://www.imaginets.com
Blog: http://blogs.officezealot.com/legault/

:

Hi,

We are using an Access application with a mail function. We create a new
mail from within the Access application, then manually add an
attachment
and send the mail to an external recipient. When the mail is received,
the
name of the attachment has changed, i.e. attachment21 (with no
extension).
The contents of the attachment cannot be read by any program, as far as
I
know.
If we create the same mail from within Outlook and add the same
attachment,
everything works as expected.
We are using Outlook 98 (8.5.5104.6), Access 97 (SR-2) and Exchange 5.5
(Build 2650.24: Service pack 3)

Any ideas of how to isolate this problem are appreciated.

This is the code we are using in the Access application:

Sub SendMessage(DisplayMsg As Boolean, strRecipient As String, Optional
varDisplay As Variant)
On Error GoTo Err_SendMessage
Dim objOutlook As outlook.Application
Dim objOutlookMsg As outlook.MailItem
Dim objOutlookRecip As outlook.Recipient
Dim objOutlookAttach As outlook.Attachment
Dim objOutlookContact As outlook.ContactItem
Dim objFolder As Object
Dim nsOutlook As outlook.NameSpace
Dim objAddress As outlook.AddressList
Dim objEntry As outlook.AddressEntry
Dim i As Integer

Set objOutlook = CreateObject("Outlook.Application")
Set nsOutlook = objOutlook.GetNamespace("MAPI")
nsOutlook.Logon
Set objOutlookMsg = objOutlook.CreateItem(olMailItem)
With objOutlookMsg
If IsMissing(varDisplay) = True Then
Set objOutlookRecip = .Recipients.Add(strRecipient)
Else
Set objOutlookRecip = .Recipients.Add(varDisplay)
End If
objOutlookRecip.type = olTo
For Each objOutlookRecip In .Recipients
objOutlookRecip.Resolve
Next
If DisplayMsg = True Then
.Display
Else
.Send
End If
End With
Set objOutlook = Nothing

Exit_SendMessage:
Exit Sub

Err_SendMessage:
MsgBox Err.Description, vbExclamation, "Send message"
Resume Exit_SendMessage
End Sub
 
In Access 97 there is no SendMail method. There is only the method
Docmd.SendObject.
When this method is used, the mail is always created in plain text format.
This is not acceptable because our policy is to have new mails created in
HTML format.

Thanks for your response. I will post my problem in another newsgroup to see
if someone knows more about the MIME/UUENCODE settings in Exchange.



Eric Legault said:
Ah, okay. Sorry, I have no idea what could be happening. My eyes glaze over
as soon as I see anything about "MIME types". :-)

Are you using Access' SendMail method, or Outlook VBA within an Access
module? If the former, maybe it's the culprit. I'm just guessing now though.

--
Eric Legault - B.A, MCP, MCSD, Outlook MVP
--------------------------------------------------
{Private e-mails ignored}
Job: http://www.imaginets.com
Blog: http://blogs.officezealot.com/legault/


abc said:
Sorry, maybe I havent explained the problem clear enough...
When the user adds the attachment, everything is still OK. The mail is then
being sent (to an external recipient) and the user assumes that the mail
arrives well.
When the recipient reads the mail there are two possibilities:
1 When the mail was sent directly from within Outlook, the recipient sees
the attachment with the right name and the attachment can be read.
2 When the mail was sent from within Access, the recipient sees an
attachment with the name "attachment21" and the attachment cannot be read.

The problem has something to do with Exchange. Everything works fine as long
as the outbound attachments in Exchange have been set to UUENCODE with
binhex turned on. However, we would like to add a disclaimer text to all
outgoing mail. This disclaimer must be added in rich text format. Therefore
it is neccesary to send mails in MIME format using HTML.
When we change the outbound attachments to MIME format, then the attachment
problem occurs.
The settings for Exchange can be found in Exchange Administrator:
<Domain> - Connections - Internet Mail Service - Properties - Internet Mail
Tab

To my opinion the problem should be solved by changing a property in
Exchange/Outlook and/or rewriting the code to create the mail exactly the
same way Outlook does.


"Eric Legault [MVP - Outlook]" <[email protected]> schreef in
bericht news:[email protected]...
Sorry, I just noticed that you did say the attachments were being added
manually. I can't see how Access or Outlook could effect any changes
to
the
attachment name. My guess is that the Windows option to "hide
extensions
for
known file types" might be enabled, thus you won't see the attachment
extension in the e-mail message.

I just tried toggling this option, and although the extensions were hidden
in Windows, they were still visible in Outlook even after I shut it
down
and
relaunched it. Perhaps they'll hide in Outlook after an OS reboot;
otherwise, I have no clue.

--
Eric Legault - B.A, MCP, MCSD, Outlook MVP
--------------------------------------------------
{Private e-mails ignored}
Job: http://www.imaginets.com
Blog: http://blogs.officezealot.com/legault/

:

When the mail is shown, the user manually adds an attachment. Just
like
you
normally add an attachment to a mail with the mouse.


"Eric Legault [MVP - Outlook]" <[email protected]>
schreef
in
bericht Your code doesn't show how you are adding the attachments, so it is
difficult
to say what the problem could be.

--
Eric Legault - B.A, MCP, MCSD, Outlook MVP
--------------------------------------------------
{Private e-mails ignored}
Job: http://www.imaginets.com
Blog: http://blogs.officezealot.com/legault/

:

Hi,

We are using an Access application with a mail function. We
create a
new
mail from within the Access application, then manually add an
attachment
and send the mail to an external recipient. When the mail is received,
the
name of the attachment has changed, i.e. attachment21 (with no
extension).
The contents of the attachment cannot be read by any program, as
far
as
I
know.
If we create the same mail from within Outlook and add the same
attachment,
everything works as expected.
We are using Outlook 98 (8.5.5104.6), Access 97 (SR-2) and
Exchange
5.5
(Build 2650.24: Service pack 3)

Any ideas of how to isolate this problem are appreciated.

This is the code we are using in the Access application:

Sub SendMessage(DisplayMsg As Boolean, strRecipient As String, Optional
varDisplay As Variant)
On Error GoTo Err_SendMessage
Dim objOutlook As outlook.Application
Dim objOutlookMsg As outlook.MailItem
Dim objOutlookRecip As outlook.Recipient
Dim objOutlookAttach As outlook.Attachment
Dim objOutlookContact As outlook.ContactItem
Dim objFolder As Object
Dim nsOutlook As outlook.NameSpace
Dim objAddress As outlook.AddressList
Dim objEntry As outlook.AddressEntry
Dim i As Integer

Set objOutlook = CreateObject("Outlook.Application")
Set nsOutlook = objOutlook.GetNamespace("MAPI")
nsOutlook.Logon
Set objOutlookMsg = objOutlook.CreateItem(olMailItem)
With objOutlookMsg
If IsMissing(varDisplay) = True Then
Set objOutlookRecip = .Recipients.Add(strRecipient)
Else
Set objOutlookRecip = .Recipients.Add(varDisplay)
End If
objOutlookRecip.type = olTo
For Each objOutlookRecip In .Recipients
objOutlookRecip.Resolve
Next
If DisplayMsg = True Then
.Display
Else
.Send
End If
End With
Set objOutlook = Nothing

Exit_SendMessage:
Exit Sub

Err_SendMessage:
MsgBox Err.Description, vbExclamation, "Send message"
Resume Exit_SendMessage
End Sub
 
Back
Top