{"id":12109,"date":"2011-12-17T17:24:01","date_gmt":"2011-12-17T17:24:01","guid":{"rendered":"http:\/\/www.learnexcelmacro.com\/?p=1072"},"modified":"2022-08-12T11:29:13","modified_gmt":"2022-08-12T11:29:13","slug":"how-to-send-email-by-excel-macro-from-outlook","status":"publish","type":"post","link":"https:\/\/vmlogger.com\/excel\/2011\/12\/how-to-send-email-by-excel-macro-from-outlook\/","title":{"rendered":"How to send email from Excel Macro from Outlook"},"content":{"rendered":"

This is continuation of my Previous Article you learnt How to Send Email From Excel VBA<\/strong>, using Gmail and Yahoo Email Account.
\n
\nIn my Previous Article, How to send email from Excel Macro<\/a>,<\/strong> as you saw how to send email by Excel VBA from Gmail or Yahoo In this article you are going to learn how to send an email automatically by Excel VBA from my Outlook. Here in this you need to make sure that you have Outlook installed in your system where your excel macro is running. Also for sending email your Outlook must be configured already.
\nBefore we get in to the code details, we need to add Microsoft Outlook 12.0 Object Librar<\/strong> reference in your Excel.
\nIf you have not added this Reference then you need to create Outlook Objects run-time.<\/p>\n

\"Adding<\/a>

Adding Outlook Reference<\/p><\/div>\n

\n\nSub SendEmailUsingOutlook()\n\nDim OlApp As New Outlook.Application\nDim myNameSp As Outlook.Namespace\nDim myInbox As Outlook.MAPIFolder\nDim myExplorer As Outlook.Explorer\nDim NewMail As Outlook.MailItem\nDim OutOpen As Boolean\n\n    ' Check to see if there's an explorer window open\n    ' If not then open up a new one\n    OutOpen = True\n    Set myExplorer = OlApp.ActiveExplorer\n    If TypeName(myExplorer) = \"Nothing\" Then\n        OutOpen = False\n        Set myNameSp = OlApp.GetNamespace(\"MAPI\")\n        Set myInbox = myNameSp.GetDefaultFolder(olFolderInbox)\n        Set myExplorer = myInbox.GetExplorer\n    End If\n\n    ' If you  don't to display your outlook while sending email then comment the below statement\n    'otherwise you can un-comment\n\n    'myExplorer.Display \n\n    ' Create a new mail message item.\n    Set NewMail = OlApp.CreateItem(olMailItem)\n    With NewMail\n        '.Display ' You don't have to show the e-mail to send it\n        .Display\n        .Subject = \"Happy New Year\"\n        .To = \"abc@email.com\"\n        .Body = \"Wishing you happy New Year\"\n        .Attachments.Add (\"C:\\log.txt\")\n    End With\n\n    NewMail.Send\n    If Not OutOpen Then OlApp.Quit\n\n    'Release memory.\n    Set OlApp = Nothing\n    Set myNameSp = Nothing\n    Set myInbox = Nothing\n    Set myExplorer = Nothing\n    Set NewMail = Nothing\n\nEnd Sub\n\n<\/code><\/pre>\n\n\n
\n 
\nTo know How to Send Email from Excel Macro using Gmail and Yahoo Account Read this Article<\/a><\/strong>
\n\n<\/td>\n<\/tr>\n<\/table>\n<\/span>","protected":false},"excerpt":{"rendered":"

This is continuation of my Previous Article you learnt How to Send Email From Excel VBA, using Gmail and Yahoo Email Account. In my Previous Article, How to send email from Excel Macro, as you saw how to send email by Excel VBA from Gmail or Yahoo In this article you are going to learn […]<\/p>\n","protected":false},"author":45,"featured_media":1073,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_et_pb_use_builder":"","_et_pb_old_content":"","_et_gb_content_width":"","footnotes":""},"categories":[5205,2077],"tags":[],"class_list":["post-12109","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-send-email","category-excel-tools"],"yoast_head":"\nHow to send email from Excel Macro from Outlook - Let's excel in Excel<\/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:\/\/vmlogger.com\/excel\/2011\/12\/how-to-send-email-by-excel-macro-from-outlook\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to send email from Excel Macro from Outlook\" \/>\n<meta property=\"og:description\" content=\"This is continuation of my Previous Article you learnt How to Send Email From Excel VBA, using Gmail and Yahoo Email Account. In my Previous Article, How to send email from Excel Macro, as you saw how to send email by Excel VBA from Gmail or Yahoo In this article you are going to learn […]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/vmlogger.com\/excel\/2011\/12\/how-to-send-email-by-excel-macro-from-outlook\/\" \/>\n<meta property=\"og:site_name\" content=\"Let's excel in Excel\" \/>\n<meta property=\"article:publisher\" content=\"http:\/\/www.facebook.com\/vmlogger\" \/>\n<meta property=\"article:author\" content=\"http:\/\/www.facebook.com\/vmlogger\" \/>\n<meta property=\"article:published_time\" content=\"2011-12-17T17:24:01+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-08-12T11:29:13+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/vmlogger.com\/excel\/wp-content\/uploads\/sites\/11\/2022\/07\/vmlogger.com_-1.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"628\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Vishwamitra Mishra\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@https:\/\/www.twitter.com\/learnexcelmacro\" \/>\n<meta name=\"twitter:site\" content=\"@learnexcelmacro\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Vishwamitra Mishra\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/vmlogger.com\/excel\/2011\/12\/how-to-send-email-by-excel-macro-from-outlook\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/vmlogger.com\/excel\/2011\/12\/how-to-send-email-by-excel-macro-from-outlook\/\"},\"author\":{\"name\":\"Vishwamitra Mishra\",\"@id\":\"https:\/\/vmlogger.com\/excel\/#\/schema\/person\/7500a107b0b2d35a8492acf0d11fc8e5\"},\"headline\":\"How to send email from Excel Macro from Outlook\",\"datePublished\":\"2011-12-17T17:24:01+00:00\",\"dateModified\":\"2022-08-12T11:29:13+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/vmlogger.com\/excel\/2011\/12\/how-to-send-email-by-excel-macro-from-outlook\/\"},\"wordCount\":172,\"commentCount\":17,\"publisher\":{\"@id\":\"https:\/\/vmlogger.com\/excel\/#\/schema\/person\/7500a107b0b2d35a8492acf0d11fc8e5\"},\"image\":{\"@id\":\"https:\/\/vmlogger.com\/excel\/2011\/12\/how-to-send-email-by-excel-macro-from-outlook\/#primaryimage\"},\"thumbnailUrl\":\"\",\"articleSection\":[\"Email\",\"Excel Tools\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/vmlogger.com\/excel\/2011\/12\/how-to-send-email-by-excel-macro-from-outlook\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/vmlogger.com\/excel\/2011\/12\/how-to-send-email-by-excel-macro-from-outlook\/\",\"url\":\"https:\/\/vmlogger.com\/excel\/2011\/12\/how-to-send-email-by-excel-macro-from-outlook\/\",\"name\":\"How to send email from Excel Macro from Outlook - Let's excel in Excel\",\"isPartOf\":{\"@id\":\"https:\/\/vmlogger.com\/excel\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/vmlogger.com\/excel\/2011\/12\/how-to-send-email-by-excel-macro-from-outlook\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/vmlogger.com\/excel\/2011\/12\/how-to-send-email-by-excel-macro-from-outlook\/#primaryimage\"},\"thumbnailUrl\":\"\",\"datePublished\":\"2011-12-17T17:24:01+00:00\",\"dateModified\":\"2022-08-12T11:29:13+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/vmlogger.com\/excel\/2011\/12\/how-to-send-email-by-excel-macro-from-outlook\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/vmlogger.com\/excel\/2011\/12\/how-to-send-email-by-excel-macro-from-outlook\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/vmlogger.com\/excel\/2011\/12\/how-to-send-email-by-excel-macro-from-outlook\/#primaryimage\",\"url\":\"\",\"contentUrl\":\"\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/vmlogger.com\/excel\/2011\/12\/how-to-send-email-by-excel-macro-from-outlook\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/vmlogger.com\/excel\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Email\",\"item\":\"https:\/\/vmlogger.com\/excel\/send-email\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"How to send email from Excel Macro from Outlook\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/vmlogger.com\/excel\/#website\",\"url\":\"https:\/\/vmlogger.com\/excel\/\",\"name\":\"Let's excel in Excel\",\"description\":\"Let's share knowledge\",\"publisher\":{\"@id\":\"https:\/\/vmlogger.com\/excel\/#\/schema\/person\/7500a107b0b2d35a8492acf0d11fc8e5\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/vmlogger.com\/excel\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/vmlogger.com\/excel\/#\/schema\/person\/7500a107b0b2d35a8492acf0d11fc8e5\",\"name\":\"Vishwamitra Mishra\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/vmlogger.com\/excel\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/vmlogger.com\/excel\/wp-content\/uploads\/sites\/11\/2022\/07\/avataaars-1.png\",\"contentUrl\":\"https:\/\/vmlogger.com\/excel\/wp-content\/uploads\/sites\/11\/2022\/07\/avataaars-1.png\",\"width\":528,\"height\":560,\"caption\":\"Vishwamitra Mishra\"},\"logo\":{\"@id\":\"https:\/\/vmlogger.com\/excel\/#\/schema\/person\/image\/\"},\"description\":\"My name is Vishwamitra Mishra. Friends Call me Vishwa. I hold a Bachelor\u2019s Degree in Computer Science from D.A.V.V. Indore & currently working as a Technical Lead having over 7 years of experience.\",\"sameAs\":[\"http:\/\/www.learnexcelmacro.com\",\"http:\/\/www.facebook.com\/vmlogger\",\"https:\/\/x.com\/https:\/\/www.twitter.com\/learnexcelmacro\",\"https:\/\/www.youtube.com\/c\/VMLogger\"],\"url\":\"https:\/\/vmlogger.com\/excel\/author\/vishwamitra\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"How to send email from Excel Macro from Outlook - Let's excel in Excel","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:\/\/vmlogger.com\/excel\/2011\/12\/how-to-send-email-by-excel-macro-from-outlook\/","og_locale":"en_US","og_type":"article","og_title":"How to send email from Excel Macro from Outlook","og_description":"This is continuation of my Previous Article you learnt How to Send Email From Excel VBA, using Gmail and Yahoo Email Account. In my Previous Article, How to send email from Excel Macro, as you saw how to send email by Excel VBA from Gmail or Yahoo In this article you are going to learn […]","og_url":"https:\/\/vmlogger.com\/excel\/2011\/12\/how-to-send-email-by-excel-macro-from-outlook\/","og_site_name":"Let's excel in Excel","article_publisher":"http:\/\/www.facebook.com\/vmlogger","article_author":"http:\/\/www.facebook.com\/vmlogger","article_published_time":"2011-12-17T17:24:01+00:00","article_modified_time":"2022-08-12T11:29:13+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/vmlogger.com\/excel\/wp-content\/uploads\/sites\/11\/2022\/07\/vmlogger.com_-1.png","type":"image\/png"}],"author":"Vishwamitra Mishra","twitter_card":"summary_large_image","twitter_creator":"@https:\/\/www.twitter.com\/learnexcelmacro","twitter_site":"@learnexcelmacro","twitter_misc":{"Written by":"Vishwamitra Mishra","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/vmlogger.com\/excel\/2011\/12\/how-to-send-email-by-excel-macro-from-outlook\/#article","isPartOf":{"@id":"https:\/\/vmlogger.com\/excel\/2011\/12\/how-to-send-email-by-excel-macro-from-outlook\/"},"author":{"name":"Vishwamitra Mishra","@id":"https:\/\/vmlogger.com\/excel\/#\/schema\/person\/7500a107b0b2d35a8492acf0d11fc8e5"},"headline":"How to send email from Excel Macro from Outlook","datePublished":"2011-12-17T17:24:01+00:00","dateModified":"2022-08-12T11:29:13+00:00","mainEntityOfPage":{"@id":"https:\/\/vmlogger.com\/excel\/2011\/12\/how-to-send-email-by-excel-macro-from-outlook\/"},"wordCount":172,"commentCount":17,"publisher":{"@id":"https:\/\/vmlogger.com\/excel\/#\/schema\/person\/7500a107b0b2d35a8492acf0d11fc8e5"},"image":{"@id":"https:\/\/vmlogger.com\/excel\/2011\/12\/how-to-send-email-by-excel-macro-from-outlook\/#primaryimage"},"thumbnailUrl":"","articleSection":["Email","Excel Tools"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/vmlogger.com\/excel\/2011\/12\/how-to-send-email-by-excel-macro-from-outlook\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/vmlogger.com\/excel\/2011\/12\/how-to-send-email-by-excel-macro-from-outlook\/","url":"https:\/\/vmlogger.com\/excel\/2011\/12\/how-to-send-email-by-excel-macro-from-outlook\/","name":"How to send email from Excel Macro from Outlook - Let's excel in Excel","isPartOf":{"@id":"https:\/\/vmlogger.com\/excel\/#website"},"primaryImageOfPage":{"@id":"https:\/\/vmlogger.com\/excel\/2011\/12\/how-to-send-email-by-excel-macro-from-outlook\/#primaryimage"},"image":{"@id":"https:\/\/vmlogger.com\/excel\/2011\/12\/how-to-send-email-by-excel-macro-from-outlook\/#primaryimage"},"thumbnailUrl":"","datePublished":"2011-12-17T17:24:01+00:00","dateModified":"2022-08-12T11:29:13+00:00","breadcrumb":{"@id":"https:\/\/vmlogger.com\/excel\/2011\/12\/how-to-send-email-by-excel-macro-from-outlook\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/vmlogger.com\/excel\/2011\/12\/how-to-send-email-by-excel-macro-from-outlook\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/vmlogger.com\/excel\/2011\/12\/how-to-send-email-by-excel-macro-from-outlook\/#primaryimage","url":"","contentUrl":""},{"@type":"BreadcrumbList","@id":"https:\/\/vmlogger.com\/excel\/2011\/12\/how-to-send-email-by-excel-macro-from-outlook\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/vmlogger.com\/excel\/"},{"@type":"ListItem","position":2,"name":"Email","item":"https:\/\/vmlogger.com\/excel\/send-email\/"},{"@type":"ListItem","position":3,"name":"How to send email from Excel Macro from Outlook"}]},{"@type":"WebSite","@id":"https:\/\/vmlogger.com\/excel\/#website","url":"https:\/\/vmlogger.com\/excel\/","name":"Let's excel in Excel","description":"Let's share knowledge","publisher":{"@id":"https:\/\/vmlogger.com\/excel\/#\/schema\/person\/7500a107b0b2d35a8492acf0d11fc8e5"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/vmlogger.com\/excel\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/vmlogger.com\/excel\/#\/schema\/person\/7500a107b0b2d35a8492acf0d11fc8e5","name":"Vishwamitra Mishra","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/vmlogger.com\/excel\/#\/schema\/person\/image\/","url":"https:\/\/vmlogger.com\/excel\/wp-content\/uploads\/sites\/11\/2022\/07\/avataaars-1.png","contentUrl":"https:\/\/vmlogger.com\/excel\/wp-content\/uploads\/sites\/11\/2022\/07\/avataaars-1.png","width":528,"height":560,"caption":"Vishwamitra Mishra"},"logo":{"@id":"https:\/\/vmlogger.com\/excel\/#\/schema\/person\/image\/"},"description":"My name is Vishwamitra Mishra. Friends Call me Vishwa. I hold a Bachelor\u2019s Degree in Computer Science from D.A.V.V. Indore & currently working as a Technical Lead having over 7 years of experience.","sameAs":["http:\/\/www.learnexcelmacro.com","http:\/\/www.facebook.com\/vmlogger","https:\/\/x.com\/https:\/\/www.twitter.com\/learnexcelmacro","https:\/\/www.youtube.com\/c\/VMLogger"],"url":"https:\/\/vmlogger.com\/excel\/author\/vishwamitra\/"}]}},"_links":{"self":[{"href":"https:\/\/vmlogger.com\/excel\/wp-json\/wp\/v2\/posts\/12109"}],"collection":[{"href":"https:\/\/vmlogger.com\/excel\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/vmlogger.com\/excel\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/vmlogger.com\/excel\/wp-json\/wp\/v2\/users\/45"}],"replies":[{"embeddable":true,"href":"https:\/\/vmlogger.com\/excel\/wp-json\/wp\/v2\/comments?post=12109"}],"version-history":[{"count":0,"href":"https:\/\/vmlogger.com\/excel\/wp-json\/wp\/v2\/posts\/12109\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/vmlogger.com\/excel\/wp-json\/"}],"wp:attachment":[{"href":"https:\/\/vmlogger.com\/excel\/wp-json\/wp\/v2\/media?parent=12109"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/vmlogger.com\/excel\/wp-json\/wp\/v2\/categories?post=12109"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/vmlogger.com\/excel\/wp-json\/wp\/v2\/tags?post=12109"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}