<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Automate email w/ attachment in Macro (module) using wscript / vbscript in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Automate-email-w-attachment-in-Macro-module-using-wscript/m-p/148691#M26945</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Eugene had a great, complete response here: &lt;A href="http://community.qlik.com/forums/p/16563/70442.aspx#70442"&gt;http://community.qlik.com/forums/p/16563/70442.aspx#70442&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I did some samurai coding with his help, and it worked.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 16 Jul 2009 04:21:37 GMT</pubDate>
    <dc:creator />
    <dc:date>2009-07-16T04:21:37Z</dc:date>
    <item>
      <title>Automate email w/ attachment in Macro (module) using wscript / vbscript</title>
      <link>https://community.qlik.com/t5/QlikView/Automate-email-w-attachment-in-Macro-module-using-wscript/m-p/148689#M26943</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Using QV 8.5, I am trying to send out an email with an attachment from a macro in a .qvw application (ReportGenerator.qvw). (see vbscript below)&lt;/P&gt;&lt;P&gt;ReportGenerator.qvw currently creates and saves an Excel file using an 'OnOpen' macro, which is initiated automatically via an External Program Task in Publisher (essentially a batch file: qv.exe /NoSecurity \\Path\ReportGenerator.qvw).&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;How can I include the appopriate microsoft libraries (as needed) to execute the following wscript in that same macro in the ReportGenerator.qvw?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;----------------- Script to send email --------------------------&lt;/P&gt;&lt;P&gt;'This script will generate an email with a file attachment. Four Arguments must be included in&lt;BR /&gt;'the execution string:&lt;BR /&gt;' Argument 0 - To email address or distribution list. Multiple addys can be separated with a comma (,)&lt;BR /&gt;' Argument 1 - Subject (enclosed in triple double quotes -no I'm not kidding- if there are spaces in the Subject)&lt;BR /&gt;' """Your Report is Attached"""&lt;BR /&gt;' Argument 2 - Body of the email (again, enclosed in triple double quotes)&lt;BR /&gt;' Argument 3 - The full path of the attachment&lt;BR /&gt;'&lt;BR /&gt;'Example Execution String (minus the beginning tick ('):&lt;BR /&gt;'wscript E:\...\Email_With_Attachment.vbs name@domain.com """Subject of Email""" """Body of Email""" \\Path\Report.xls&lt;/P&gt;&lt;P&gt;Set args=wscript.Arguments&lt;/P&gt;&lt;P&gt;varTo = args(0)&lt;BR /&gt;varSubject = args(1)&lt;BR /&gt;varTextBody = args(2)&lt;BR /&gt;varAttachment = args(3)&lt;/P&gt;&lt;P&gt;Dim ObjSendMail&lt;BR /&gt;Set ObjSendMail = CreateObject("CDO.Message")&lt;BR /&gt;&lt;BR /&gt;'This section provides the configuration information for the remote SMTP server.&lt;BR /&gt;&lt;BR /&gt;ObjSendMail.Configuration.Fields.Item ("&lt;A href="http://schemas.microsoft.com/cdo/configuration/sendusing"&gt;http://schemas.microsoft.com/cdo/configuration/sendusing&lt;/A&gt;") = 2 'Send the message using the network (SMTP over the network).&lt;BR /&gt;ObjSendMail.Configuration.Fields.Item ("&lt;A href="http://schemas.microsoft.com/cdo/configuration/smtpserver"&gt;http://schemas.microsoft.com/cdo/configuration/smtpserver&lt;/A&gt;") = "smtp...." &amp;lt;&amp;lt;&amp;lt;&amp;lt; Insert SMTP server here&lt;BR /&gt;ObjSendMail.Configuration.Fields.Update&lt;BR /&gt;&lt;BR /&gt;ObjSendMail.To = varTo&lt;BR /&gt;ObjSendMail.Subject = varSubject&lt;BR /&gt;ObjSendMail.From = "&lt;A href="mailto:name@domain.com"&gt;name@domain.com&lt;/A&gt;"&lt;BR /&gt;&lt;BR /&gt;' we are sending a text email.. simply switch the comments around to send an html email instead&lt;BR /&gt;'ObjSendMail.HTMLBody = "this is the body"&lt;BR /&gt;ObjSendMail.TextBody = varTextBody&lt;BR /&gt;ObjSendMail.AddAttachment varAttachment&lt;BR /&gt;&lt;BR /&gt;ObjSendMail.Send&lt;BR /&gt;&lt;BR /&gt;Set ObjSendMail = Nothing&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;'In addition to what you see here there are plenty of properties you can add to these examples.&lt;BR /&gt;'Here are a few examples.&lt;/P&gt;&lt;P&gt;'Carbon Copy&lt;BR /&gt;'ObjSendMail.CC = "&lt;A href="mailto:someone@someone.net"&gt;someone@someone.net&lt;/A&gt;"&lt;/P&gt;&lt;P&gt;'Blind Carbon Copy&lt;BR /&gt;'ObjSendMail.BCC = "&lt;A href="mailto:someone@someone.net"&gt;someone@someone.net&lt;/A&gt;"&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Jul 2009 22:02:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Automate-email-w-attachment-in-Macro-module-using-wscript/m-p/148689#M26943</guid>
      <dc:creator />
      <dc:date>2009-07-07T22:02:15Z</dc:date>
    </item>
    <item>
      <title>Automate email w/ attachment in Macro (module) using wscript / vbscript</title>
      <link>https://community.qlik.com/t5/QlikView/Automate-email-w-attachment-in-Macro-module-using-wscript/m-p/148690#M26944</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;As I understand it, the CDO libraries are server based - they need to run on a server.&lt;/P&gt;&lt;P&gt;On a client, you would have to get a COM based SMTP control to call from VBS to send emails. You can't do it through Outlook anymore because it will pop up the security requestor to confirm that the external application is allowed send emails.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Stephen&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Jul 2009 22:17:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Automate-email-w-attachment-in-Macro-module-using-wscript/m-p/148690#M26944</guid>
      <dc:creator>stephencredmond</dc:creator>
      <dc:date>2009-07-07T22:17:22Z</dc:date>
    </item>
    <item>
      <title>Automate email w/ attachment in Macro (module) using wscript / vbscript</title>
      <link>https://community.qlik.com/t5/QlikView/Automate-email-w-attachment-in-Macro-module-using-wscript/m-p/148691#M26945</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Eugene had a great, complete response here: &lt;A href="http://community.qlik.com/forums/p/16563/70442.aspx#70442"&gt;http://community.qlik.com/forums/p/16563/70442.aspx#70442&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I did some samurai coding with his help, and it worked.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jul 2009 04:21:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Automate-email-w-attachment-in-Macro-module-using-wscript/m-p/148691#M26945</guid>
      <dc:creator />
      <dc:date>2009-07-16T04:21:37Z</dc:date>
    </item>
  </channel>
</rss>

