{"id":33,"date":"2016-02-22T10:25:46","date_gmt":"2016-02-22T10:25:46","guid":{"rendered":"http:\/\/gearmage.com\/blog\/?p=33"},"modified":"2026-02-05T22:52:03","modified_gmt":"2026-02-05T22:52:03","slug":"save-emails-and-attachments-to-a-database","status":"publish","type":"post","link":"https:\/\/gearmage.com\/blog\/save-emails-and-attachments-to-a-database\/","title":{"rendered":"Save emails and attachments to a database"},"content":{"rendered":"<h1>Save emails and attachments to a database (SQL Server)<\/h1>\n<p>In this post, we will explore saving emails and attachments to a database server\u00a0like\u00a0SQL Server by setting up an ODBC data source and using a post download Action to save contents of the email and\/or attachments to a database.<\/p>\n<p>The program supports and works with\u00a0<strong>any compatible ODBC data source<\/strong>\u00a0such as <strong>MySQL<\/strong>, <strong>Oracle, PostgreSQL\u00a0<\/strong>and more.\u00a0This post only explores setting up to save the data in SQL Server but also has information on how to tweak it for other database types.<\/p>\n<h3>An overview &#8212; emails to databases<\/h3>\n<p>The feature of saving emails to databases is <em>just one of the features<\/em> available with the\u00a0<a href=\"https:\/\/gearmage.com\/buymaildownloader.html\" target=\"_blank\" rel=\"noopener noreferrer\">Mail Attachment Downloader PRO Server<\/a>\u00a0version.<\/p>\n<blockquote><p>Each rule can be setup to save emails to databases using either generated SQL (to one or more tables) or a custom SQL.<\/p>\n<p>You do not need to know SQL to save emails or attachments to a database. And if you do know SQL, it offers the flexibility and customizability to modify the SQL statements to suit your needs.<\/p>\n<p>You can even include\u00a0<em>extracted data from emails or attachments<\/em>\u00a0using custom variables in your SQL statement and save them to a database!<\/p><\/blockquote>\n<p>Each rule has several phases &#8212; first, search and filter through emails or attachments, then extract data from emails or attachments, saving email bodies or attachments to a customizable file or folder format if needed and lastly post-process the emails or attachments by saving them to a database of your choice.<a href=\"https:\/\/gearmage.com\/blog\/extract-emails-integrate\/emailprocessphases-2\/\" rel=\"attachment wp-att-139\"><br \/>\n<\/a><\/p>\n<p><a href=\"https:\/\/gearmage.com\/blog\/extract-emails-integrate\/emailprocessphases-2\/\" rel=\"attachment wp-att-139\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"size-large wp-image-139 aligncenter\" src=\"https:\/\/i0.wp.com\/gearmage.com\/blog\/wp-content\/uploads\/2016\/06\/EmailProcessPhases-1.png?resize=474%2C261&#038;ssl=1\" alt=\"email processing\" width=\"474\" height=\"261\" srcset=\"https:\/\/i0.wp.com\/gearmage.com\/blog\/wp-content\/uploads\/2016\/06\/EmailProcessPhases-1.png?resize=1024%2C563&amp;ssl=1 1024w, https:\/\/i0.wp.com\/gearmage.com\/blog\/wp-content\/uploads\/2016\/06\/EmailProcessPhases-1.png?resize=300%2C165&amp;ssl=1 300w, https:\/\/i0.wp.com\/gearmage.com\/blog\/wp-content\/uploads\/2016\/06\/EmailProcessPhases-1.png?resize=768%2C422&amp;ssl=1 768w, https:\/\/i0.wp.com\/gearmage.com\/blog\/wp-content\/uploads\/2016\/06\/EmailProcessPhases-1.png?resize=672%2C372&amp;ssl=1 672w, https:\/\/i0.wp.com\/gearmage.com\/blog\/wp-content\/uploads\/2016\/06\/EmailProcessPhases-1.png?w=1196&amp;ssl=1 1196w\" sizes=\"auto, (max-width: 474px) 85vw, 474px\" \/><\/a><\/p>\n<p><em>Used by many Fortune 500 companies today to save emails and attachments to databases. \u00a0Runs 24&#215;7 in the cloud or on-premise as a Windows Service.<\/em><\/p>\n<p>You get a versatile tool that provides flexibility in storing emails to databases in just the way you want to.<\/p>\n<hr \/>\n<h3>Step-by-step tutorial &#8212; emails to databases<\/h3>\n<h4>Setting up a datasource<\/h4>\n<ol>\n<li>Let&#8217;s start off by adding a new data source &#8212; \u00a0click on the <strong>Database<\/strong> tab -&gt; <strong>Add ODBC source<\/strong> button<img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-34\" src=\"https:\/\/i0.wp.com\/gearmage.com\/blog\/wp-content\/uploads\/2016\/02\/Screen-Shot-2016-02-22-at-9.48.42-PM.png?resize=524%2C174&#038;ssl=1\" alt=\"Database Source\" width=\"524\" height=\"174\" srcset=\"https:\/\/i0.wp.com\/gearmage.com\/blog\/wp-content\/uploads\/2016\/02\/Screen-Shot-2016-02-22-at-9.48.42-PM.png?w=524&amp;ssl=1 524w, https:\/\/i0.wp.com\/gearmage.com\/blog\/wp-content\/uploads\/2016\/02\/Screen-Shot-2016-02-22-at-9.48.42-PM.png?resize=300%2C100&amp;ssl=1 300w\" sizes=\"auto, (max-width: 524px) 85vw, 524px\" \/><\/li>\n<li>Provide a name for the source first. Then pick either the <strong>32-bit ODBC driver or 62-bit ODBC driver\u00a0<\/strong>(<span style=\"text-decoration: underline;\">depending on whether you installed the 32-bit or 64-bit version of Mail Attachment Downloader PRO Client or PRO Server<\/span>).In our case, the driver &#8220;<strong>SQL Server<\/strong>&#8221; from the drop down indicates the 32-bit driver. \u00a0Then enter the Connection string that specifies how to connect to the server:<code><small>Server=&lt;computer name&gt;\\&lt;SQL Server name&gt;;Database=&lt;DB name&gt;;Trusted_Connection=yes;<\/small><\/code>\n<p>The above connection string is specific to SQL Server that is using a trusted connection. To connect in any other way to SQL Server OR to another database like Oracle, you can find <a href=\"https:\/\/www.connectionstrings.com\/\">ODBC connection strings here (make sure you select <strong>ODBC connection string<\/strong> and not any other on the site)<\/a>.<\/p>\n<p>An example of these filled in is shown below:<br \/>\n<code><small>Server=TESTPC\\GEARMAGE;Database=TestDB;Trusted_Connection=yes;<br \/>\n<\/small><\/code><br \/>\n<img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-36\" src=\"https:\/\/i0.wp.com\/gearmage.com\/blog\/wp-content\/uploads\/2016\/02\/DBDetails2.jpg?resize=487%2C121&#038;ssl=1\" alt=\"DBDetails2\" width=\"487\" height=\"121\" srcset=\"https:\/\/i0.wp.com\/gearmage.com\/blog\/wp-content\/uploads\/2016\/02\/DBDetails2.jpg?w=487&amp;ssl=1 487w, https:\/\/i0.wp.com\/gearmage.com\/blog\/wp-content\/uploads\/2016\/02\/DBDetails2.jpg?resize=300%2C75&amp;ssl=1 300w\" sizes=\"auto, (max-width: 487px) 85vw, 487px\" \/><\/li>\n<li>Click <strong>Test Connection<\/strong> button to make sure this succeeds. Then click OK.<\/li>\n<li>At this point a data source has been setup.<\/li>\n<\/ol>\n<h4>Rule configuration to save the email to a database<\/h4>\n<ol>\n<li>Then\u00a0create a new rule or edit an existing rule from\u00a0the <strong>Global filters<\/strong>\u00a0tab.<\/li>\n<li>Under <strong>Actions after save <\/strong>click <strong>Add action\u00a0<\/strong>and then choose <strong>Save to database<\/strong>. This will add an action under <strong>After saving file<\/strong> in the list to the left.<br \/>\n<strong>NOTE:<\/strong> The screenshot below shows other actions as well, if you have other actions you can <a href=\"https:\/\/gearmage.com\/blog\/email-actions-unzip-convert-pdf-run-script\/\">chain or nest<\/a> the save to database action after those actions have taken place as shown below.<\/p>\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-185\" src=\"https:\/\/i0.wp.com\/gearmage.com\/blog\/wp-content\/uploads\/2016\/02\/Save-to-DB.png?resize=745%2C330&#038;ssl=1\" alt=\"Save to DB\" width=\"745\" height=\"330\" srcset=\"https:\/\/i0.wp.com\/gearmage.com\/blog\/wp-content\/uploads\/2016\/02\/Save-to-DB.png?w=745&amp;ssl=1 745w, https:\/\/i0.wp.com\/gearmage.com\/blog\/wp-content\/uploads\/2016\/02\/Save-to-DB.png?resize=300%2C133&amp;ssl=1 300w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px\" \/><\/li>\n<li>Pick the <strong>Source<\/strong> as the one you provided in Step-2.<\/li>\n<li>Specify\u00a0a new <strong>table name<\/strong> (or an existing one)\u00a0and then click &#8220;<strong>Create Table<\/strong>&#8221; if this is a new table and follow the prompts.\u00a0 At this point a new table schema would be created and the SQL would be automatically filled in based on the questions you answered.<\/li>\n<li>Click &#8220;<strong>Test SQL<\/strong>&#8221; to test connectivity and table row creation, this will add a new row to the table to make sure everything is setup correctly.<\/li>\n<li>Click the\u00a0<strong>Save\u00a0<\/strong>button to save the new rule with the <strong>Save to DB<\/strong> action.<\/li>\n<li>Now you can click the\u00a0<strong>Connect And Download<\/strong>\u00a0button to test out\u00a0the ability to save to DB.<\/li>\n<\/ol>\n<p>That&#8217;s it!<\/p>\n<p>You have setup the program to automatically save emails and attachments to a database.<\/p>\n<h3>IMPORTANT CONSIDERATIONS<\/h3>\n<ol>\n<li>Make sure you select either the\u00a0<strong>32-bit ODBC driver\u00a0<\/strong>or the\u00a0<strong>64-bit ODBC driver<\/strong>\u00a0in the dropdown depending on which installation of Mail Attachment Downloader PRO Client or PRO Server you installed (license email has links to both versions of the install). This is supported in all Windows versions including Windows 10. In some cases default installations may only install the 64-bit driver and you may need to manually download and install the 32-bit ODBC driver for your database. Please consult the database documentation and Google on how to do this.<\/li>\n<li>Your specific <strong>connection string<\/strong>\u00a0can vary depending on the type of database (for example, Oracle has different connection strings than MySQL). A useful site to help you with the ODBC connection string is\u00a0<a href=\"https:\/\/www.connectionstrings.com\"><strong>https:\/\/www.connectionstrings.com<\/strong>.\u00a0<\/a>Make sure you only choose the\u00a0<strong>ODBC connection string <\/strong>in the site<strong> \u00a0<\/strong>for your<strong>\u00a0<\/strong>database type (like Oracle). You may need to play around with the different strings and test connections to find the one that works. If your connection string includes a Driver name, make sure it matches exactly (space for space) the one you have picked in the dropdown.<\/li>\n<li>Depending on the type of DB you use, the automatic creation of table\/sql may fail. In that case, you might have to provision the schema for the table in the DB manually and then specify the SQL to insert records into the table in the program.<\/li>\n<li>You can save the attachment content using the following variable in your SQL\n<pre>{RAW_CONTENT}<\/pre>\n<\/li>\n<\/ol>\n<h3>Further reading<\/h3>\n<p>Some interesting how-to links and posts for further exploration:<\/p>\n<ul>\n<li>Save rows inside of\u00a0a\u00a0<a href=\"https:\/\/gearmage.com\/blog\/save-csv-excels-to-a-database\/\">CSV or Excel<\/a>\u00a0attached in an email\u00a0<a href=\"https:\/\/gearmage.com\/blog\/save-csv-excels-to-a-database\/\">to a SQL database<\/a>!<\/li>\n<li>Save to\u00a0<a href=\"https:\/\/gearmage.com\/blog\/multiple-email-accounts-via-rules\/\">multiple folders from multiple accounts using multiple email rules<\/a>.<\/li>\n<li><a href=\"https:\/\/gearmage.com\/blog\/automate-sending-emails\/\">Send emails automatically<\/a>\u00a0after downloading files or attachments or body<\/li>\n<li><a href=\"https:\/\/gearmage.com\/blog\/email-actions-unzip-convert-pdf-run-script\/\">Unzip files, Decrypt pdf\u2019s and run script\u2019s<\/a><\/li>\n<li>Extract data and\u00a0<a href=\"https:\/\/gearmage.com\/blog\/emails-invoice-processing\/\">download emails for invoice processing<\/a><\/li>\n<li><a href=\"https:\/\/gearmage.com\/blog\/convert-email-attachments-to-pdf\/\">Convert email attachments<\/a>\u00a0to different formats<\/li>\n<li>How\u00a0<a href=\"https:\/\/gearmage.com\/blog\/extract-emails-integrate\/\">email rules work<\/a>\u00a0in-depth<\/li>\n<\/ul>\n<h3>Contact us<\/h3>\n<p><a href=\"mailto:support@gearmage.com\">Contact us<\/a>\u00a0if you have any questions, suggestions about the\u00a0functionality described in this article.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Save emails and attachments to a database (SQL Server) In this post, we will explore saving emails and attachments to a database server\u00a0like\u00a0SQL Server by setting up an ODBC data source and using a post download Action to save contents of the email and\/or attachments to a database. The program supports and works with\u00a0any compatible &hellip; <a href=\"https:\/\/gearmage.com\/blog\/save-emails-and-attachments-to-a-database\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Save emails and attachments to a database&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":185,"comment_status":"closed","ping_status":"open","sticky":true,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[4,6],"tags":[13,16],"class_list":["post-33","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-mad","category-tips","tag-save-emails-to-a-database","tag-sql-server"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Save emails and attachments to a database - Gearmage Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/gearmage.com\/blog\/save-emails-and-attachments-to-a-database\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Save emails and attachments to a database - Gearmage Blog\" \/>\n<meta property=\"og:description\" content=\"Save emails and attachments to a database (SQL Server) In this post, we will explore saving emails and attachments to a database server\u00a0like\u00a0SQL Server by setting up an ODBC data source and using a post download Action to save contents of the email and\/or attachments to a database. The program supports and works with\u00a0any compatible &hellip; Continue reading &quot;Save emails and attachments to a database&quot;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/gearmage.com\/blog\/save-emails-and-attachments-to-a-database\/\" \/>\n<meta property=\"og:site_name\" content=\"Gearmage Blog\" \/>\n<meta property=\"article:published_time\" content=\"2016-02-22T10:25:46+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-02-05T22:52:03+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/gearmage.com\/blog\/wp-content\/uploads\/2016\/02\/Save-to-DB.png\" \/>\n\t<meta property=\"og:image:width\" content=\"745\" \/>\n\t<meta property=\"og:image:height\" content=\"330\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"gearmage\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"gearmage\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/gearmage.com\\\/blog\\\/save-emails-and-attachments-to-a-database\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/gearmage.com\\\/blog\\\/save-emails-and-attachments-to-a-database\\\/\"},\"author\":{\"name\":\"gearmage\",\"@id\":\"https:\\\/\\\/gearmage.com\\\/blog\\\/#\\\/schema\\\/person\\\/c8728645787bff3555b5873b43161652\"},\"headline\":\"Save emails and attachments to a database\",\"datePublished\":\"2016-02-22T10:25:46+00:00\",\"dateModified\":\"2026-02-05T22:52:03+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/gearmage.com\\\/blog\\\/save-emails-and-attachments-to-a-database\\\/\"},\"wordCount\":1047,\"publisher\":{\"@id\":\"https:\\\/\\\/gearmage.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/gearmage.com\\\/blog\\\/save-emails-and-attachments-to-a-database\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/i0.wp.com\\\/gearmage.com\\\/blog\\\/wp-content\\\/uploads\\\/2016\\\/02\\\/Save-to-DB.png?fit=745%2C330&ssl=1\",\"keywords\":[\"save emails to a database\",\"SQL Server\"],\"articleSection\":[\"Mail Attachment Downloader\",\"Tips\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/gearmage.com\\\/blog\\\/save-emails-and-attachments-to-a-database\\\/\",\"url\":\"https:\\\/\\\/gearmage.com\\\/blog\\\/save-emails-and-attachments-to-a-database\\\/\",\"name\":\"Save emails and attachments to a database - Gearmage Blog\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/gearmage.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/gearmage.com\\\/blog\\\/save-emails-and-attachments-to-a-database\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/gearmage.com\\\/blog\\\/save-emails-and-attachments-to-a-database\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/i0.wp.com\\\/gearmage.com\\\/blog\\\/wp-content\\\/uploads\\\/2016\\\/02\\\/Save-to-DB.png?fit=745%2C330&ssl=1\",\"datePublished\":\"2016-02-22T10:25:46+00:00\",\"dateModified\":\"2026-02-05T22:52:03+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/gearmage.com\\\/blog\\\/save-emails-and-attachments-to-a-database\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/gearmage.com\\\/blog\\\/save-emails-and-attachments-to-a-database\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/gearmage.com\\\/blog\\\/save-emails-and-attachments-to-a-database\\\/#primaryimage\",\"url\":\"https:\\\/\\\/i0.wp.com\\\/gearmage.com\\\/blog\\\/wp-content\\\/uploads\\\/2016\\\/02\\\/Save-to-DB.png?fit=745%2C330&ssl=1\",\"contentUrl\":\"https:\\\/\\\/i0.wp.com\\\/gearmage.com\\\/blog\\\/wp-content\\\/uploads\\\/2016\\\/02\\\/Save-to-DB.png?fit=745%2C330&ssl=1\",\"width\":745,\"height\":330,\"caption\":\"Save to DB\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/gearmage.com\\\/blog\\\/save-emails-and-attachments-to-a-database\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/gearmage.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Save emails and attachments to a database\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/gearmage.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/gearmage.com\\\/blog\\\/\",\"name\":\"Gearmage Blog\",\"description\":\"Email Processing Tools and Solutions\",\"publisher\":{\"@id\":\"https:\\\/\\\/gearmage.com\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/gearmage.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/gearmage.com\\\/blog\\\/#organization\",\"name\":\"Gearmage\",\"url\":\"https:\\\/\\\/gearmage.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/gearmage.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/i0.wp.com\\\/gearmage.com\\\/blog\\\/wp-content\\\/uploads\\\/2016\\\/02\\\/cropped-cropped-GearMage.jpg?fit=240%2C58&ssl=1\",\"contentUrl\":\"https:\\\/\\\/i0.wp.com\\\/gearmage.com\\\/blog\\\/wp-content\\\/uploads\\\/2016\\\/02\\\/cropped-cropped-GearMage.jpg?fit=240%2C58&ssl=1\",\"width\":240,\"height\":58,\"caption\":\"Gearmage\"},\"image\":{\"@id\":\"https:\\\/\\\/gearmage.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/gearmage.com\\\/blog\\\/#\\\/schema\\\/person\\\/c8728645787bff3555b5873b43161652\",\"name\":\"gearmage\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/ca0fad01f9a63241bc21d4f1f44befe7c62e4ee3bb268fb1adaadc2e49ed0699?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/ca0fad01f9a63241bc21d4f1f44befe7c62e4ee3bb268fb1adaadc2e49ed0699?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/ca0fad01f9a63241bc21d4f1f44befe7c62e4ee3bb268fb1adaadc2e49ed0699?s=96&d=mm&r=g\",\"caption\":\"gearmage\"},\"url\":\"https:\\\/\\\/gearmage.com\\\/blog\\\/author\\\/wp-admin\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Save emails and attachments to a database - Gearmage Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/gearmage.com\/blog\/save-emails-and-attachments-to-a-database\/","og_locale":"en_US","og_type":"article","og_title":"Save emails and attachments to a database - Gearmage Blog","og_description":"Save emails and attachments to a database (SQL Server) In this post, we will explore saving emails and attachments to a database server\u00a0like\u00a0SQL Server by setting up an ODBC data source and using a post download Action to save contents of the email and\/or attachments to a database. The program supports and works with\u00a0any compatible &hellip; Continue reading \"Save emails and attachments to a database\"","og_url":"https:\/\/gearmage.com\/blog\/save-emails-and-attachments-to-a-database\/","og_site_name":"Gearmage Blog","article_published_time":"2016-02-22T10:25:46+00:00","article_modified_time":"2026-02-05T22:52:03+00:00","og_image":[{"width":745,"height":330,"url":"https:\/\/gearmage.com\/blog\/wp-content\/uploads\/2016\/02\/Save-to-DB.png","type":"image\/png"}],"author":"gearmage","twitter_card":"summary_large_image","twitter_misc":{"Written by":"gearmage","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/gearmage.com\/blog\/save-emails-and-attachments-to-a-database\/#article","isPartOf":{"@id":"https:\/\/gearmage.com\/blog\/save-emails-and-attachments-to-a-database\/"},"author":{"name":"gearmage","@id":"https:\/\/gearmage.com\/blog\/#\/schema\/person\/c8728645787bff3555b5873b43161652"},"headline":"Save emails and attachments to a database","datePublished":"2016-02-22T10:25:46+00:00","dateModified":"2026-02-05T22:52:03+00:00","mainEntityOfPage":{"@id":"https:\/\/gearmage.com\/blog\/save-emails-and-attachments-to-a-database\/"},"wordCount":1047,"publisher":{"@id":"https:\/\/gearmage.com\/blog\/#organization"},"image":{"@id":"https:\/\/gearmage.com\/blog\/save-emails-and-attachments-to-a-database\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/gearmage.com\/blog\/wp-content\/uploads\/2016\/02\/Save-to-DB.png?fit=745%2C330&ssl=1","keywords":["save emails to a database","SQL Server"],"articleSection":["Mail Attachment Downloader","Tips"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/gearmage.com\/blog\/save-emails-and-attachments-to-a-database\/","url":"https:\/\/gearmage.com\/blog\/save-emails-and-attachments-to-a-database\/","name":"Save emails and attachments to a database - Gearmage Blog","isPartOf":{"@id":"https:\/\/gearmage.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/gearmage.com\/blog\/save-emails-and-attachments-to-a-database\/#primaryimage"},"image":{"@id":"https:\/\/gearmage.com\/blog\/save-emails-and-attachments-to-a-database\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/gearmage.com\/blog\/wp-content\/uploads\/2016\/02\/Save-to-DB.png?fit=745%2C330&ssl=1","datePublished":"2016-02-22T10:25:46+00:00","dateModified":"2026-02-05T22:52:03+00:00","breadcrumb":{"@id":"https:\/\/gearmage.com\/blog\/save-emails-and-attachments-to-a-database\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/gearmage.com\/blog\/save-emails-and-attachments-to-a-database\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/gearmage.com\/blog\/save-emails-and-attachments-to-a-database\/#primaryimage","url":"https:\/\/i0.wp.com\/gearmage.com\/blog\/wp-content\/uploads\/2016\/02\/Save-to-DB.png?fit=745%2C330&ssl=1","contentUrl":"https:\/\/i0.wp.com\/gearmage.com\/blog\/wp-content\/uploads\/2016\/02\/Save-to-DB.png?fit=745%2C330&ssl=1","width":745,"height":330,"caption":"Save to DB"},{"@type":"BreadcrumbList","@id":"https:\/\/gearmage.com\/blog\/save-emails-and-attachments-to-a-database\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/gearmage.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Save emails and attachments to a database"}]},{"@type":"WebSite","@id":"https:\/\/gearmage.com\/blog\/#website","url":"https:\/\/gearmage.com\/blog\/","name":"Gearmage Blog","description":"Email Processing Tools and Solutions","publisher":{"@id":"https:\/\/gearmage.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/gearmage.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/gearmage.com\/blog\/#organization","name":"Gearmage","url":"https:\/\/gearmage.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/gearmage.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/i0.wp.com\/gearmage.com\/blog\/wp-content\/uploads\/2016\/02\/cropped-cropped-GearMage.jpg?fit=240%2C58&ssl=1","contentUrl":"https:\/\/i0.wp.com\/gearmage.com\/blog\/wp-content\/uploads\/2016\/02\/cropped-cropped-GearMage.jpg?fit=240%2C58&ssl=1","width":240,"height":58,"caption":"Gearmage"},"image":{"@id":"https:\/\/gearmage.com\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/gearmage.com\/blog\/#\/schema\/person\/c8728645787bff3555b5873b43161652","name":"gearmage","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/ca0fad01f9a63241bc21d4f1f44befe7c62e4ee3bb268fb1adaadc2e49ed0699?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/ca0fad01f9a63241bc21d4f1f44befe7c62e4ee3bb268fb1adaadc2e49ed0699?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/ca0fad01f9a63241bc21d4f1f44befe7c62e4ee3bb268fb1adaadc2e49ed0699?s=96&d=mm&r=g","caption":"gearmage"},"url":"https:\/\/gearmage.com\/blog\/author\/wp-admin\/"}]}},"jetpack_featured_media_url":"https:\/\/i0.wp.com\/gearmage.com\/blog\/wp-content\/uploads\/2016\/02\/Save-to-DB.png?fit=745%2C330&ssl=1","jetpack-related-posts":[],"jetpack_likes_enabled":true,"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/gearmage.com\/blog\/wp-json\/wp\/v2\/posts\/33","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gearmage.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gearmage.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gearmage.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/gearmage.com\/blog\/wp-json\/wp\/v2\/comments?post=33"}],"version-history":[{"count":7,"href":"https:\/\/gearmage.com\/blog\/wp-json\/wp\/v2\/posts\/33\/revisions"}],"predecessor-version":[{"id":991,"href":"https:\/\/gearmage.com\/blog\/wp-json\/wp\/v2\/posts\/33\/revisions\/991"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/gearmage.com\/blog\/wp-json\/wp\/v2\/media\/185"}],"wp:attachment":[{"href":"https:\/\/gearmage.com\/blog\/wp-json\/wp\/v2\/media?parent=33"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gearmage.com\/blog\/wp-json\/wp\/v2\/categories?post=33"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gearmage.com\/blog\/wp-json\/wp\/v2\/tags?post=33"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}