source code, coding, asp.net, C#, php, ruby, sql, oracle,android,node.js,javascript,linux,unix, random stuffs etc.
Monday, August 27, 2007
Register an activex component
look for regsvr32.exe in system/system32 folder in windows (note down the path)
Open dos prompt and do it!
C:\system32>regsvr32 c:\youractivex.ocx
A messagebox will appear if the ocx gets registered.
call a page from vbscript
=========================
Sometimes you may be in a situation where you are required to call a webpage (intranet/www) via a vbscript running locally.
Eg: Suppose you want to send email attachment via asp but want to put it in a schedular. In this call you might write the emailing logic in a asp page and make the below vbscript and put it in a local schedular.(windows schedular)
Script to be written in a vbscript
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run("http://localhost/mywebpage/sendmail.asp")
set WshShell = Nothing
Alternate option is to write the logic in a oracle/ms sql server stored procedure and put it in a schedular / call the vbscript from oracle/sql server schedular.
Saturday, August 25, 2007
VB Script to send email
VB Script to send email
==================
'this is self explainatory
strFrom = "from@domain.com"
strTo = "to@domain.com"
strSub = "Your subject"
strBody = "Your body"
strSMTP = "smtp.domain.com"
set objEmail = CreateObject("CDO.Message")
objEmail.From = strFrom
objEmail.To = strTo
objEmail.Subject = strSub
objEmail.Textbody = strBody
objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = strSMTP
objEmail.Configuration.Fields.Update
objEmail.Send
WScript.Echo "Email sent successfully"
'obviously to run the above u need to configure the ports and configure smtp!!...otherwise above won't run.