Item attachments

images\assignattachment.jpg

Please note:

Mail Folders can contain huge amount of attachment data!

Synchronizing attachments will affect performance!
Be sure you have enough space in your database to store attachments.
Be sure your network can handle attachment synchronization!

 

Every Outlook/Exchange Item (Contact, Task, Mail etc.) can contain 0 or more attachments. Attachment can be any type of file, image, OLE object, message or only a link reference. Contact Pictures (Outlook 2003 and higher) are also stored as attachments. HTML Body of an Email, Contact etc. can contain images or other objects, these objects are also stored as attachments in Outlook/Exchange.

 

To synchronize attachments your attachment table must:

·      Contain a column to store attachment number (zero based index of the attachment).

·      Contain a foreign key to the parent table (Table used on Folder Items Tab)

·      Contain a blob / image column to store the attachment data or you must set extraction directory.

 

It is not mandatory to map other Attachment columns, but Outlook may not be able to recognize attachments when loading attachments to Outlook!

 

Working of the Item Attachments dialog is almost identical to Assign table –Folder Items dialog, with the following differences:

Parent table mappings and primary keys (Assign Table – Folder Items dialog) must be specified before defining the attachment mappings.

 

Enable attachment support
Check this option to enable attachment synchronization

 

Reuse connection

If checked (default) GeniusConnect will reuse connection info used for parent table (Folder Items Tab). To use a different database connection, uncheck the checkbox.

 

Map the attachment columns to table columns and specify Attachment parent table mappings (Mandatory Keys button)

 

Extract attachments to a folder

 

images\extractionfolder.jpg


Set a folder for attachments extraction.

 

Remove extracted files on attachment delete
If checked, file will be deleted on attachment delete

 

When using extraction:

1-   "Attachment full path and filename" column MUST BE LINKED TO A TABLE COLUMN! GeniusConnect will store full path and file name in DB column linked to "Attachment full path and filename".
File name format: <parent primary key>_<attachment index>_<original attachment name>.<original file type>. Example: 100_0_
myfilename.doc

2-   You do not have to link “Attachment binarycolumn

 

Contact pictures in Outlook 2003 and higher
Outlook is using fixed values to recognize Contact Picture between other “normal” attachments.

 

When importing from a file, you must provide Outlook with these values:

Attachment filename: must be empty

Attachment full path and filename: <file> Example: d:\foto\mypicture.jpg

Attachment long filename: ContactPicture.jpg (this is mandatory, Outlook always uses this fixed name in attachment table)

Attachment method:1

Attachment rendering position:-1

 

When importing directly from DB (blob column):

Attachment binary: the picture

Attachment filename: must be empty

Attachment long filename: ContactPicture.jpg

Attachment method:1

Attachment rendering position:-1

 

 

Available attachment columns:

 

Attachment binary
Contains binary attachment data

Attachment content id
Embedded HTML Body image content identification header (only used with *HTMLBody)

Attachment content location
Embedded HTML Body image content identification header (only used with *HTMLBody)

Attachment filename
Attachment base filename and extension, excluding path

Attachment full path and filename
Attachment fully qualified path and filename

Attachment long filename
Attachment long filename and extension, excluding path.

Attachment method
Constant representing the way the contents of an attachment can be accessed.
1=Attachment binary contains the attachment data by value
2=full path and filename contains a fully qualified path identifying the attachment to recipients with access to a common file server
3=full path and filename contains a fully qualified path identifying the attachment
4=Same as 3 but the messaging system never resolves the reference(link only)
5=Attachment binary is an embedded message
6=Attachment binary is an embedded OLE object

Attachment mime tag
Formatting information about a Multipurpose Internet Mail Extensions (MIME) attachment. The composition of the string is defined in the RFC 1521 document. The format is type/subtype, such as application/binary or text/plain

Attachment number
MUST BE LINKED TO A TABLE COLUMN! Contains a number that uniquely identifies the attachment within its parent message.

Attachment rendering position
Offset, in characters, to use in rendering an attachment within the main message text.
All values other than 1 indicate the position within *HTMLBody at which the attachment is to be rendered.

Attachment is a contact picture
Read-only flag

 

*You need to map these columns only if you are also linking “HTMLBody” column in Assign table – Folder Items dialog. If the plain-text version of the body (“Body” Column) is used, Outlook will ignore the HTML formatting info in the attachments.

 

Please note:
Values
and formatting of attachments columns depends on:

Outlook version, Exchange version, other Messaging systems (messages/mail from other mail systems) etc.

 

Filter rows button
function is identical to
Assign table – Folder Items dialog.


Options button
this button will activate the SQL Commands dialog. You can specify custom stored procedures for Insert/Update/Delete statements. If not used, GeniusConnect will generate default SQL Commands based on mappings.

 

Export / Import button function is identical to Assign table – Folder Items dialog.

 

 

Example SQL Server Attachments Table:

CREATE TABLE [dbo].[MailAttachment] (

[gc_parent_guid] [uniqueidentifier] NOT NULL ,

[gc_attach_number] [int] NOT NULL ,

[GC_ATTACH_FILENAME] [varchar] (100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,

[GC_ATTACH_LONG_FILENAME] [varchar] (100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,

[GC_ATTACH_METHOD] [int] NULL ,

[GC_ATTACH_MIME_TAG] [varchar] (200) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,

[GC_RENDERING_POSITION] [int] NULL ,

[GC_ATTACH_CONTENT_LOCATION] [varchar] (200) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,

[GC_ATTACH_BINARY] [image] NULL ,

[GC_ATTACH_CONTENT_ID] [varchar] (200) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,

[GC_ATTACH_FULL_PATH_AND_NAME] [varchar] (400) COLLATE SQL_Latin1_General_CP1_CI_AS NULL

) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

 

 

Attachment Examples

 

See also:

Attachment parent table mappings

Export / Import settings