Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Qlik view send mail problam

Dear all

Kindly help me very urgent basic

we have integrate qlik view send mail in our application but we have facing some problem(Error)

My code are

function sendMailTest()

Dim objEmail

Const cdoSendUsingPort = 2 ' Send the message using SMTP

Const cdoAnonymous = 0 'Do not authenticate
Const cdoBasic = 1 'basic (clear-text) authentication
Const cdoNTLM = 2 'NTLM


SMTPServer = getVariable("SMTPServer")
Const SMTPPort = 25 ' Port number for SMTP
Const SMTPTimeout = 60 ' Timeout for SMTP in seconds


'Sending mail
Set objEmail = CreateObject("CDO.Message")
Set objConf = objEmail.Configuration
Set objFlds = objConf.Fields
With objFlds
'---------------------------------------------------------------------
' SMTP server details
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = cdoSendUsingPort
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = SMTPServer
.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = cdoAnonymous
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = SMTPPort
.Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = False
.Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = SMTPTimeout
.Update
'---------------------------------------------------------------------
End With

objEmail.To = getVariable("EmailTo") 'Email Recipient
objEmail.From = getVariable("EmailFrom") 'Email Sender
objEmail.Subject = getVariable("EmailSubject") ' Subject
objEmail.TextBody = getVariable("EmailBody") 'Text Body
objEmail.AddAttachment getVariable("Attachement") ' Attachement

objEmail.Send ' (We are facing problem here i think )

Set objFlds = Nothing
Set objConf = Nothing
Set objEmail = Nothing

msgbox ("Test Mail Sent")

end function

function getVariable(varName)
set v = ActiveDocument.Variables(varName)
getVariable = v.GetContent.String
end function

Plaese check my code

Regards

Ashish Kumar

0 Replies