Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
datanibbler
Champion
Champion

email from QlikView


Hi,

this is a rather old and already-much-discussed feature. Still: I have the following dilemma:

- I have both QVS and RtM (a third-party tool to automate reports) running on the company server.

- This server, for very understandable reasons, does not and will not have Outlook or any other emailing program installed.

- I can set up in any QlikView_app an alert with emails - those emails will be triggered upon Reload on the server, but only
   be sent once I open the app locally. I can, however, do that by simply putting it in the "Startup" folder, so it will be
   started in the morning once I boot up my laptop.
   I can also set for this alert a condition that can never be true, so it will fire daily and send those emails.
   <=> I cannot add any attachments to those emails.

Can any of you suggest to me a possible way around this dilemma?

Thanks a lot!

Best regards,

DataNibbler

17 Replies
marcus_sommer

Hi DataNibbler,

you could use a windows-feature "cdo.message" with vbs - have a look on this example:

http://community.qlik.com/message/296673#296673

- Marcus

datanibbler
Champion
Champion
Author

Hi Marcus,

that looks helpful. This code begins with that line "SET objEmail ...", right? So I don't have to process all of that discussion?

That is a code that I could put into a "module" in a QlikView_app, right?

The code uses some email_function on the Microsoft_servers, right?

That would not necessarily have to run on the server then - depending on the times of day when this reporting would be required, I could have it run on my own laptop. Well, strictly speaking, I'd be a bit astonished if the Server_admins were to allow a program to automatically access the Internet, without direct interaction at the time - but since I know from experience that they do allow QlikView_apps to run command lines, it's probable.

I will try it out.

marcus_sommer

Hi DataNibbler,

yes, try it at first with copy/paste from this code, uncomment the attachment, change the From & To part and change the server-name/server-ip with them from your exchange-server (you could find themin your outlook-account properties if you press change account - and it should work.

More examples and explanations could you find here: http://www.paulsadowski.com/wsh/cdo.htm

- Marcus

datanibbler
Champion
Champion
Author

Hi,

ok, I have copied your code and pasted it into a module in my app.

What did you mean by "uncomment the attachment"? What should I uncomment?

I changed the From and the To parts and for the >> Path&File << (attachment) I added an actual filepath (incl. filename and ending).

When I click on "Test", the first message that I get reads "Expected statement" with just that filepath highlighted.

I used the path to a file on my Desktop, the line now reads

>>  objEmail.AddAttachment C:\Users\friedrich.hofmann\Desktop\Staplerkosten_56LFS.pdf  <<

I guess I also have to change something about those config lines, but I'll go about it step by step as I don't have anything much in the way of experience with vbs ...

Thanks a lot!

Best regards,

DataNibbler

marcus_sommer

Hi,

I meant with uncomment the attachment excactly this:

'objEmail.AddAttachment Path & File

simply to check if the mailing itself worked. If the attachment-statement failed then because the attachment or the path didn't exists or the access rights are wrong or it contained any chars which needed to wrapped into double-quotes - most often a PathFile sould be look like "C:\SomeFolder\AnyFile.FileExtension".

- Marcus

datanibbler
Champion
Champion
Author

Ah. Thanks!

Well, I'll uncomment it then and try again.

Now the message is "The transport failed to connect to the server."  and the very last line >> objEmail.Send << is highlighted.

As to the servername, I did what you suggested in my Outlook program (strangely, what it showed me there is slightly different from what IT once told me to set up in the QMC, but that results in the very same message, I tried)

and I put that inside the double quotes in the line

>> objEmail.Configuration.Fields.Item(config & "smtpserver") <<

I guess I have to activate again the lines after that (about the authentication) - although the email_server_settings in the QMC include no kind of authentication?

I have set both of the dropdown boxes on the left side to "access external files"

´

So what do you think could be the issue this time?

P.S.: I had a look at this paulsadowski.com - there are some advanced examples of things I am not thinking of yet, but no specific explanation of this basic part as far as I could see.

marcus_sommer

For me it worked with these default-settings. Maybe your settings are customized in some way. If you have already mail-settings in qmc and/or client try it with them. If this don't work ask your server-guys for the settings (especially with authentication) and if they have some securitiy settings (firewall, group policies ...) which could block this. If this not really helped then it will be a rather unpleasant trial and error game - maybe you will find here more: https://www.google.de/?gws_rd=ssl#q=cdo.message%2C+The+transport+failed+to+connect+to+the+server

- Marcus

datanibbler
Champion
Champion
Author

Thanks Marcus!

I'll try.

I'm sure the server_admins have some security settings in place on the server - there's a reason they don't want Outlook on the Server and for the same reason they will not be extremely willing to help me set up a macro to send email from the server ...

I will have to try, though.

Thanks a lot for helping!

Best regards,

DataNibbler

datanibbler
Champion
Champion
Author

Hi Marcus,

I have now entered the settings IT gave me for the QMC in that line about the SMTP_Server.

In the QMC, there is no authentication (it is set to "use Distribution Service Account") - the DistributionService is being run by a dedicated "QlikView_user" that has a username and password set. => So I am not sure if the parameter 1 in that line about "smtpauthenticate" is right and whether I need the following lines.

Maybe I can contact that Paul Sadovski about it?

Worth a shot, I guess.

Best regards,

DataNibbler