SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
Mail.Send Error in VBScript Job

 
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite View previous topic
View next topic
Mail.Send Error in VBScript Job
Author Message
jeff33190



Joined: 22 Aug 2007
Posts: 96

Post Mail.Send Error in VBScript Job Reply with quote
I am trying to write a job in 24x7 scheduler 5.1.403 using vbscript. I am trying to use the mail.send function but it errors anytime I try to pass a variable for any of the parameters. It works fine if I hard-code each parameter. Here is a simplified example:

This Works:

Code:
Call Main
Sub Main( )
Mail.Send "24x7@company.com","","user@company.com", "Subject" ,"Testing"
End Sub


This code fails with the error: Type mismatch: 'Mail.Send'
Code:
Call Main
Sub Main( )
   mailsubject = "Subject"
   Mail.Send "24x7@company.com","","user@company.com", mailsubject ,"Testing"
End Sub


Any ideas what I am doing wrong?
Tue Jun 04, 2013 6:03 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7833

Post Reply with quote
It looks like the declaration f the variable is missing

Code:
...
Dim mailsubject
mailsubject = "Subject"
Mail.Send "24x7@company.com","","user@company.com", mailsubject ,"Testing"
...

Tue Jun 04, 2013 9:59 pm View user's profile Send private message
jeff33190



Joined: 22 Aug 2007
Posts: 96

Post Reply with quote
Sorry, I left that out, but I had already tried declaring the variable and even tried setting a string constant. Any time I try to pass a variable or a constant to the mail.send function I get the error:

Type mismatch:'Mail.Send'

Thanks,
Jeff
Wed Jun 05, 2013 8:57 am View user's profile Send private message
jeff33190



Joined: 22 Aug 2007
Posts: 96

Post Reply with quote
Is this just a bug in the mail.send function?
Mon Jun 10, 2013 4:58 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7833

Post Reply with quote
Not sure why the difference, but the following seem to work

Code:
Dim mailsubject
mailsubject = "Subject"
Mail.Send "24x7@company.com", "","user@company.com",  "Subject:",  "Testing"


and this works too

Code:
Dim mailsubject
mailsubject = "Subject"
Mail.Send "24x7@company.com", "","user@company.com", _
    "Subject:" &  "test email", _
    "Testing"

Tue Jun 11, 2013 8:25 am View user's profile Send private message
Display posts from previous:    
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite All times are GMT - 4 Hours
Page 1 of 1

 
Jump to: 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


 

 

Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Flowers Online.