Skip to main content
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
Showing results for 
Search instead for 
Did you mean: 

Sending emails from Qlikview

Evening all

I was hoping that some of the more tech savvy members would be able to assist or point me in the right direction.

I want to be able to send an email with a .pdf report attached to a selection of users on a daily basis. I have developed the Qlikview app that writes out the .pdf and can mail the report from my desktop version when not linked to the company network. I got the code from the forum. It uses the gmail smtp server to send the mail.

Once I try to run Qlikview from our warehouse server it returns the message 'The transport failed to connect to the server'. When running on the company server I use the company SMTP server and not the gmail server.

What is strange is that I can send an email using Powershell. I use the same parameters in my Qlikview model as Powershell. I have worked with our sever engineer to try to get it to work without success. It seems to me to be a setting on the server/virus protection/mail server. In order to get the mail to send they setup the mail server to allow it to relay messages. The code below is what I use.

SUB SendMail
Dim objEmail
Const cdoSendUsingPort = 2 ' Send the message using SMTP
Const cdoBasicAuth = 1 ' Clear-text authentication Const
cdoTimeout = 60 ' Timeout for SMTP in seconds 
mailServer = ""
SMTPport = 25
mailusername = ""
mailpassword = ""
mailto = ";"
mailSubject = "Report 01"
mailBody = "This is the email body" 
Set objEmail = CreateObject("CDO.Message")
Set objConf = objEmail.Configuration
Set objFlds = objConf.Fields
With objFlds
.Item("") = cdoSendUsingPort
.Item("") = mailServer
.Item("") = SMTPport
.Item("") = True
.Item("") = cdoTimeout
.Item("") = cdoBasicAuth
.Item("") = mailusername
.Item("") = mailpassword
End With
objEmail.To = mailto
objEmail.From = mailusername
objEmail.Subject = mailSubject
objEmail.TextBody = mailBody
objEmail.AddAttachment "C:\QlikView Printing.pdf"
Set objFlds = Nothing
Set objConf = Nothing
Set objEmail = Nothing


The sending fails on the objEmail.Send statement

Some input would be appreciated, especially if some advise on possible server settings that need to be enabled.


Braham Edwards

2 Replies
Specialist II
Specialist II

Hi Edwards,

Please refer the below thread to configure users in qvw.

QlikView Scheduled & Automated Reports – Sending Excel via Email


Hi Kalyan

I did look at the post you mentioned, but it is sent from a gmail SMTP server. My script works from a gmail account, but not from our exchange server.