  | 
			
				SoftTree Technologies 
				Technical Support Forums
			 | 
		 
		  | 
	 
	 
	
	
	
		
	
	
	
		| Author | 
		Message | 
	 
	
		
			jeff33190 
			 
			
  
			
			
				Joined: 22 Aug 2007 Posts: 96
  | 
			 
			  
		 | 
		
			
				  Mail.Send Error in VBScript Job | 
				     | 
			 
			
				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:
 
 
	  | 
	
 
	  | 
	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'
 
	  | 
	
 
	  | 
	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 | 
		          | 
	 
	
		  | 
	 
	
		
			SysOp 
			Site Admin 
			
  
			
			
				Joined: 26 Nov 2006 Posts: 7992
  | 
			 
			  
		 | 
		
			
				   | 
				     | 
			 
			
				It looks like the declaration f the variable is missing
 
 
	  | 
	
 
	  | 
	...
 
Dim mailsubject
 
mailsubject = "Subject" 
 
Mail.Send "24x7@company.com","","user@company.com", mailsubject ,"Testing" 
 
... | 
	 
 
  | 
			 
		  | 
	 
	
		| Tue Jun 04, 2013 9:59 pm | 
		          | 
	 
	
		  | 
	 
	
		
			jeff33190 
			 
			
  
			
			
				Joined: 22 Aug 2007 Posts: 96
  | 
			 
			  
		 | 
		
			
				   | 
				     | 
			 
			
				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 | 
		          | 
	 
	
		  | 
	 
	
		
			jeff33190 
			 
			
  
			
			
				Joined: 22 Aug 2007 Posts: 96
  | 
			 
			  
		 | 
		
			
				   | 
				     | 
			 
			
				Is this just a bug in the mail.send function?
  | 
			 
		  | 
	 
	
		| Mon Jun 10, 2013 4:58 pm | 
		          | 
	 
	
		  | 
	 
	
		
			SysOp 
			Site Admin 
			
  
			
			
				Joined: 26 Nov 2006 Posts: 7992
  | 
			 
			  
		 | 
		
			
				   | 
				     | 
			 
			
				Not sure why the difference, but the following seem to work
 
 
	  | 
	
 
	  | 
	Dim mailsubject 
 
mailsubject = "Subject" 
 
Mail.Send "24x7@company.com", "","user@company.com",  "Subject:",  "Testing" | 
	 
 
 
 
and this works too
 
 
	  | 
	
 
	  | 
	Dim mailsubject 
 
mailsubject = "Subject" 
 
Mail.Send "24x7@company.com", "","user@company.com", _
 
    "Subject:" &  "test email", _
 
    "Testing" | 
	 
 
  | 
			 
		  | 
	 
	
		| Tue Jun 11, 2013 8:25 am | 
		          | 
	 
	
		  | 
	 
	
		 | 
	 
 
  
	 
	    
	   | 
	
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
  | 
   
 
		 | 
	 
	  |