Prevent Users from sending large attachments

H

halk

Here's the situation:
I want to prevent MS Outlook users from sending any attached files
larger than 3 mb.


My company is in a small office environment. We have about 35 PC's
running everything from Outlook 97 to Outlook 2003.


We are using a Cobalt Qube email server, which is about five or six
years old. It does an adequate job most of the time. However, it has
limited administrative features.


Every so often, one of our sales people will send out an email with a
large attachment - 6 mb, 12 mb, yesterday it was 19 mb. It was
addressed to 12 people on staff. Needless to say it crushed our Cobalt
Qube. Email ground to a halt while everyone slowly downloaded the file.



Is there a way to go into Outlook and restrict the size of an attached
file in an outgoing email?

I'm very good with MS Access, Word and Excel VBA - so I feel confident
I could do something with VBA in Outlook, if someone can point me in
the right direction.

Thank you,


Harold Kay
Weatherbeeta USA, Inc.
 
M

Michael Bauer

Am 24 Aug 2005 06:46:44 -0700 schrieb halk:

Harold, you can use this sample. It prompts the user if a mail is bigger
than a pre-defined value.


Private Sub Application_ItemSend(ByVal Item As Object, Cancel As
Boolean)
If TypeOf Item Is Outlook.MailItem Then
Cancel=Not SendBigMail(Item)
End If
End Sub

Private Function SendBigMail(oMail As Outlook.MailItem) As Boolean
Dim lSize As Long
Const MAX_SIZE As Long = 10000 ' Byte
Dim bSend As Boolean

bSend = True
If oMail.Attachments.Count Then
lSize = oMail.Size
If lSize > MAX_SIZE Then
bSend = (MsgBox("Size: " & lSize & " Byte. Cancel?", vbYesNo) =
vbNo)
End If
End If
SendBigMail = bSend
End Function
 
E

Eric Legault [MVP - Outlook]

Assuming your are using Exchange (as most ISPs won't allow attachments of the
size you are already sending), there are a few administrative options that
can be set to control this:

How to set size limits for messages in Exchange Server:
http://support.microsoft.com/?id=322679

From a development perspective, you can gain additional control before the
message is even delivered by writing a COM Add-In with an Inspector wrapper
to detect whenever an attachment is added to a new e-mail message. However,
you'd have to either use CDO to get the attachment size, or write the file to
disk and use the Microsoft Scripting Runtime Library to set a reference to a
File object and get the Size property. Then if it exceeds a hard-coded or
managed value, remove the attachment.

You could also create an SMTP event sink in Exchange to trap all delivered
e-mails and inspect the attachment size, but this may not be necessary with
all the provided admin options anyway.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top