Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have a problem with a macro to sending mail:
Server:
64B,
Windows 2008 SP2
QlikView Server 11
Desktop 11 R5
QV Document
1.- It has a macro to send email using a mail account with the proper code.
2.- The corresponding setting in a macro editor and in a document, referent a security and access to system are ok.
2.- In a bat file there are the necessary command to invoke qv.exe and the document.
Running the task
1.- In a manual mode no problem, the mail it sent.
2.- When use scheduled task of server and run it, no problem
3.- When close the conn, (not log off), the task not send email and the task administrator show it with zero activiy, but en memory.
Finding the "error", I created diferent scheduled task according below:
1.- Task under Windows 2008 (options in task)
2.- Task under Windows 2003 (options in task)
3.- bat file with param /r
4.- bat file with param /l
5.- bat file with param /v to trigger or not the macro.
6.- bat file with without param
7.- Trigger macro onPostReload
8.- Trigger macro onOpen
9.- Run task at user belong administrator Group
10.- Run task at user administrator
11.- Run task with other account gmail.
Note.-
When the task is in point 2.., and sometime, the macro editor is open and the macro stop, but not error is present, only stop.
I debug the macro and the problem maybe the mail routine because without this code lines, the macro don't stop.
Anybody know a similar situation and how to resolve this?
This is the code macro for sending email:
Sub EnviarGmail(sTo, sSubject, sBody, sFile)
' Object creation
Set objMsg = CreateObject("CDO.Message")
Set msgConf = CreateObject("CDO.Configuration")
' Server Configuration
msgConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
msgConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.gmail.com"
msgConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 465
msgConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
msgConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = "cuenta@dominio.net"
msgConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "password"
msgConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = 1
msgConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
msgConf.Fields.Update
' Email
objMsg.To = sTO
objMsg.From = "cuenta@dominio.net"
objMsg.Subject = sSubject
objMsg.HTMLBody = sBody
objMsg.Sender = "xxxx"
for i=0 to 9
if sFile(i) <> "" then
objMsg.AddAttachment sFile(i)
ActiveDocument.GetApplication.WaitForIdle
end if
Next
Set objMsg.Configuration = msgConf
objMsg.Send
Set objMsg = nothing
Set msgConf = nothing
End Sub
Thk.
Ulises
nobody any suggest?
First and for Most you try to reload manually see it reload ok and giving log file ok.
Vikas
Hi Vikas
I can reload manually without problem and the log file is ok, but when i disconnected or loged out from server the task start and working one or twice and to the next sequence sotpedd and qv remain with zero cpu... and nothing appear at email...
Recently downlload a scheduler software, put in it the task and is the same... the task remain without activity...
Ulises
Hii,
While setting Task in windows Scheduler Please attached setting.
Hope your problem will resolve.
Good Luck
Vikas
PFA settings
Thks for your answer,
I will change the settings tonight.
BR.
Hi,
I changed the sttings and nothing,
I made a delphi program that send a simple mail, y made a scheduler task and is the same, works only 1 or twice and then stopped, is another problem.
Y discovery that the windows is Windows 2008 standard SP2, not Windows 2008 R2 SP1, maybe it's the problema?
Thks...