Do not use MAPI. Configure 24x7 to use SMTP email. : Hi : When I have 24X7 run as a service and I have the job start notification : checked : with the notification action being send email. : I get the following error : Notification Action failed.Sending mail failed.Logon Failed : It continues to run and sucessfully ends the application : but the vbscript code that I have to send email does not send the email. : If I stop the service and run the stand alone version every thing works : perfectly fine. : I need to know how to get this to work when its being run as a service.I am : running this on a Windows XP proffessional. : The following is the VB script : Sub Main() : Dim fso, DailyRecptFile : dim sFileName : sFileName="C:\temp\DailyReceipt.xls" : Set fso = CreateObject("Scripting.FileSystemObject") : If (fso.FileExists(sFileName)) Then : Set DailyRecptFile = fso.GetFile(sFileName) : DailyRecptFile.Delete : end if : 'Email the file to intended recepients : dim sRecepients,sBody : sRecepients="gVarughese@synavant.com" : sBody ="TEST" : SendMail sRecepients , "Test" ,sBody , sFileName : end sub : Sub SendMail(sAddress , sSubject , sBody , sAttachment ) : On Error resume next : Dim App : Dim Itm : Dim i : Dim lPos : Dim iCount : Dim sDisplayName 'This will hold the name of the file without path : sDisplayName="Daily Receipt Report" : Set App = CreateObject("Outlook.Application") : Set Itm = App.CreateItem(0) : 'Parse the attachments to get individual attachments : 'icount will contain the number of attacments : iCount = 1'ParseString(sAttachments, s_arrAttacments(), ";") : With Itm : .Subject = sSubject : .To = sAddress : .Body = sBody & chr(13) & chr(13) : lPos = Len(.Body) + 1000 : 'Loop through the attacments, adding each attacmnet : 'get the name of the file : lPos = lPos + 1000 : 'Add attachments if file exists : .Attachments.Add sAttachment, 1, lPos, sDisplayName : .Send : End With : End Sub : Your help will be appreciated : Thanks : Geogie Varughese
|