<?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 Re: Sending mails macro vbs in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Sending-mails-macro-vbs/m-p/390731#M698961</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have the same problem had. Problem seems to be that that CDO.Message requires run with priority and not as background process. Change the task parameter from /r&amp;nbsp; to&amp;nbsp; /l in your batch file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REM /r = open+reload+save+close as background process&amp;nbsp; /l = open+reload+save with GUI&lt;/P&gt;&lt;P&gt;"D:\QlikView_Client\QV.exe" /l "D:\YOURFILE.qvw"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Calibri','sans-serif';"&gt;Marcus&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 03 Jan 2013 15:18:24 GMT</pubDate>
    <dc:creator>marcus_sommer</dc:creator>
    <dc:date>2013-01-03T15:18:24Z</dc:date>
    <item>
      <title>Sending mails macro vbs</title>
      <link>https://community.qlik.com/t5/QlikView/Sending-mails-macro-vbs/m-p/390730#M698960</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have the next issue:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm able to send mails with a macro using customer smtp server through Qlikview Desktop, I have a windows task to reload my document and a trigger that executes my macro after reload, I know this works because part of my macro exports to excel a few tables, the problem is sending mails part of the macro, that doesn´t work and I don't know why, the user that executes the task has mail account of the customer SMTP server. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don´t know why is working fine through Qlikview Desktop and&amp;nbsp; not working through windows task....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help, please??&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Jan 2013 12:56:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sending-mails-macro-vbs/m-p/390730#M698960</guid>
      <dc:creator>chematos</dc:creator>
      <dc:date>2013-01-03T12:56:16Z</dc:date>
    </item>
    <item>
      <title>Re: Sending mails macro vbs</title>
      <link>https://community.qlik.com/t5/QlikView/Sending-mails-macro-vbs/m-p/390731#M698961</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have the same problem had. Problem seems to be that that CDO.Message requires run with priority and not as background process. Change the task parameter from /r&amp;nbsp; to&amp;nbsp; /l in your batch file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REM /r = open+reload+save+close as background process&amp;nbsp; /l = open+reload+save with GUI&lt;/P&gt;&lt;P&gt;"D:\QlikView_Client\QV.exe" /l "D:\YOURFILE.qvw"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Calibri','sans-serif';"&gt;Marcus&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Jan 2013 15:18:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sending-mails-macro-vbs/m-p/390731#M698961</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2013-01-03T15:18:24Z</dc:date>
    </item>
    <item>
      <title>Re: Sending mails macro vbs</title>
      <link>https://community.qlik.com/t5/QlikView/Sending-mails-macro-vbs/m-p/390732#M698962</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="background-color: #ffffff; font-size: 12.727272033691406px; color: #737373; font-family: Arial;"&gt;Hi Marcus, I've tried your solution but the task doesn´t finish ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff; font-size: 12.727272033691406px; color: #737373; font-family: Arial;"&gt;/r = open+reload+save+close&lt;/P&gt;&lt;P style="background-color: #ffffff; font-size: 12.727272033691406px; color: #737373; font-family: Arial;"&gt;/l = open+reload+save&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; and close??? Could be that the problem??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff; font-size: 12.727272033691406px; color: #737373; font-family: Arial;"&gt;Thank you&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Jan 2013 15:46:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sending-mails-macro-vbs/m-p/390732#M698962</guid>
      <dc:creator>chematos</dc:creator>
      <dc:date>2013-01-03T15:46:15Z</dc:date>
    </item>
    <item>
      <title>Re: Sending mails macro vbs</title>
      <link>https://community.qlik.com/t5/QlikView/Sending-mails-macro-vbs/m-p/390733#M698963</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I make finish after save+export+send in the end of send-routine per&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ActiveDocument.closedoc&lt;/P&gt;&lt;P&gt;ActiveDocument.GetApplication.Quit&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Send mails works now?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Jan 2013 16:01:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sending-mails-macro-vbs/m-p/390733#M698963</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2013-01-03T16:01:41Z</dc:date>
    </item>
    <item>
      <title>Re: Sending mails macro vbs</title>
      <link>https://community.qlik.com/t5/QlikView/Sending-mails-macro-vbs/m-p/390734#M698964</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don´t think so because the task remain in execution indefinitely ... &lt;/P&gt;&lt;P&gt;I'm waiting feedback of my customer, I have no access to the mail account.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is my code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sub ExportarAgendas&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;' ///////////////////export code //////////////'&lt;/P&gt;&lt;P&gt;....&lt;/P&gt;&lt;P&gt;'/////////// end export code////////////////'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;' Below mailing code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Set objMsg = CreateObject("CDO.Message") &lt;/P&gt;&lt;P&gt;Set msgConf = CreateObject("CDO.Configuration") &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;' Server Configuration &lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;msgConf.Fields.Item("&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://schemas.microsoft.com/cdo/configuration/sendusing"&gt;http://schemas.microsoft.com/cdo/configuration/sendusing&lt;/A&gt;&lt;SPAN&gt;") = 2 &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;msgConf.Fields.Item("&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://schemas.microsoft.com/cdo/configuration/smtpserver"&gt;http://schemas.microsoft.com/cdo/configuration/smtpserver&lt;/A&gt;&lt;SPAN&gt;") = "servername"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;msgConf.Fields.Item("&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://schemas.microsoft.com/cdo/configuration/smtpserverport"&gt;http://schemas.microsoft.com/cdo/configuration/smtpserverport&lt;/A&gt;&lt;SPAN&gt;") = 25 &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;msgConf.Fields.Item("&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://schemas.microsoft.com/cdo/configuration/smtpauthenticate"&gt;http://schemas.microsoft.com/cdo/configuration/smtpauthenticate&lt;/A&gt;&lt;SPAN&gt;") = 0&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;msgConf.Fields.Item("&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://schemas.microsoft.com/cdo/configuration/sendusername"&gt;http://schemas.microsoft.com/cdo/configuration/sendusername&lt;/A&gt;&lt;SPAN&gt;") = "" &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;msgConf.Fields.Item("&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://schemas.microsoft.com/cdo/configuration/sendpassword"&gt;http://schemas.microsoft.com/cdo/configuration/sendpassword&lt;/A&gt;&lt;SPAN&gt;") = ""&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;msgConf.Fields.Item("&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://schemas.microsoft.com/cdo/configuration/smtpusessl"&gt;http://schemas.microsoft.com/cdo/configuration/smtpusessl&lt;/A&gt;&lt;SPAN&gt;") = 0 &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;msgConf.Fields.Update &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MailToVar = ActiveDocument.Variables("To").GetContent.string&lt;/P&gt;&lt;P&gt;objMsg.To = MailToVar&amp;nbsp; &lt;/P&gt;&lt;P&gt;MailFromVar= ActiveDocument.Variables("From").GetContent. String&lt;/P&gt;&lt;P&gt;objMsg.From =&amp;nbsp; MailFromVar&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;objMsg.Subject = "blablablabla" &lt;/P&gt;&lt;P&gt;objMsg.HTMLBody = "blablablabla" &lt;/P&gt;&lt;P&gt;objMsg.Sender = " " &lt;/P&gt;&lt;P&gt;objMsg.AddAttachment "Path\Document.xls"&lt;/P&gt;&lt;P&gt;objMsg.AddAttachment "Path\Document.xls"&lt;/P&gt;&lt;P&gt;objMsg.AddAttachment "Path\Document.xls"&lt;/P&gt;&lt;P&gt;Set objMsg.Configuration = msgConf &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;' Send &lt;/P&gt;&lt;P&gt;objMsg.Send&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;'msgbox "enviado"&lt;/P&gt;&lt;P&gt;'&lt;/P&gt;&lt;P&gt;Set objMsg = nothing &lt;/P&gt;&lt;P&gt;Set msgConf = nothing &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ActiveDocument.closedoc&lt;/P&gt;&lt;P&gt;ActiveDocument.GetApplication.Quit&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;end sub&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Jan 2013 17:03:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sending-mails-macro-vbs/m-p/390734#M698964</guid>
      <dc:creator>chematos</dc:creator>
      <dc:date>2013-01-03T17:03:04Z</dc:date>
    </item>
    <item>
      <title>Re: Sending mails macro vbs</title>
      <link>https://community.qlik.com/t5/QlikView/Sending-mails-macro-vbs/m-p/390735#M698965</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I use this code for sending mails an I use this not from the data application, but from a control application, which run per loop through a lot of data applications and execute various reloads+export+send. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ActiveDocument.closedoc (original newdoc.closedoc) --&amp;gt; is here wrong, then it made to closed the data application and without ActiveDocument the quit-order will failed&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Set objEmail = CreateObject("CDO.Message") 'Sending mail&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;'This section provides the configuration information for the remote SMTP server.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;config = "&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://schemas.microsoft.com/cdo/configuration/"&gt;http://schemas.microsoft.com/cdo/configuration/&lt;/A&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;objEmail.Configuration.Fields.Item(config &amp;amp; "sendusing") = 2 '&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://msdn.microsoft.com/en-us/library/exchange/ms873037%28v=exchg.65%29.aspx"&gt;http://msdn.microsoft.com/en-us/library/exchange/ms873037%28v=exchg.65%29.aspx&lt;/A&gt;&lt;/P&gt;&lt;P&gt;objEmail.Configuration.Fields.Item(config &amp;amp; "smtpserver") = " smtpserver " 'Name or IP of Remote SMTP Server&lt;/P&gt;&lt;P&gt;'objEmail.Configuration.Fields.Item (config &amp;amp; "smtpauthenticate") = 1 'Clear Text - Type of authentication, NONE, Basic (Base64 encoded), NTLM&lt;/P&gt;&lt;P&gt;'objEmail.Configuration.Fields.Item(config &amp;amp; "sendusername") = "youruserid" 'Your UserID on the SMTP server&lt;/P&gt;&lt;P&gt;'objEmail.Configuration.Fields.Item(config &amp;amp; "sendpassword") = "yourpassword" 'Your password on the SMTP server&lt;/P&gt;&lt;P&gt;objEmail.Configuration.Fields.Item(config &amp;amp; "smtpserverport") = 25 'Server port (typically 25)&lt;/P&gt;&lt;P&gt;objEmail.Configuration.Fields.Item(config &amp;amp; "smtpusessl") = False 'Use SSL for the connection (False or True)&lt;/P&gt;&lt;P&gt;objEmail.Configuration.Fields.Item(config &amp;amp; "smtpconnectiontimeout") = 60 'Connection Timeout in seconds (the maximum time CDO will try to establish a connection to the SMTP server)&lt;/P&gt;&lt;P&gt;objEmail.Configuration.Fields.Update&lt;/P&gt;&lt;P&gt;'End remote SMTP server configuration section&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;objEmail.From = "&lt;/SPAN&gt;&lt;A class="jive-link-email-small" href="mailto:me@me.com"&gt;me@me.com&lt;/A&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;objEmail.To = " &lt;/SPAN&gt;&lt;A class="jive-link-email-small" href="mailto:me@me.com"&gt;me@me.com&lt;/A&gt;&lt;SPAN&gt; "&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;objEmail.Subject = "xxxx"&lt;/P&gt;&lt;P&gt;objEmail.TextBody = "xxx"&lt;/P&gt;&lt;P&gt;objEmail.AddAttachment Path&amp;amp;File&lt;/P&gt;&lt;P&gt;objEmail.Send&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Set objEmail = Nothing&lt;/P&gt;&lt;P&gt;ActiveDocument.GetApplication.Quit&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Jan 2013 08:28:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sending-mails-macro-vbs/m-p/390735#M698965</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2013-01-04T08:28:48Z</dc:date>
    </item>
    <item>
      <title>Re: Sending mails macro vbs</title>
      <link>https://community.qlik.com/t5/QlikView/Sending-mails-macro-vbs/m-p/390736#M698966</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Marcus, thanks for your help, it was very usefull.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Finally, I could send mails, but the reason why I couldn´t was because the execution in background resets security of the module, so I needed to allow access to the system in module security and local security. &lt;/P&gt;&lt;P&gt;If you don´t allow access in modul security, local security is reset to safe mode, but if you do, local security is saved.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards and thank you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Jan 2013 13:12:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sending-mails-macro-vbs/m-p/390736#M698966</guid>
      <dc:creator>chematos</dc:creator>
      <dc:date>2013-01-07T13:12:52Z</dc:date>
    </item>
  </channel>
</rss>

