473,395 Members | 1,335 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

server name in vbscript file problem

Hi,

I am trying to use the below to send an email in a vbscript file...but am fairly unfamilar with vbscript.

It works fine until i put in the line to get the server name -
strServer = Request.ServerVariables("SERVER_NAME")

What is wrong...and what should i use to get the server name

Thanks

-------------------------------------



sch = "http://schemas.microsoft.com/cdo/configuration/"

strServer = Request.ServerVariables("SERVER_NAME"))

Set cdoConfig = CreateObject("CDO.Configuration")

With cdoConfig.Fields
.Item(sch & "sendusing") = 2 ' cdoSendUsingPort
.Item(sch & "smtpserver") = "<mailserver>"
.update
End With


Set cdoMessage = CreateObject("CDO.Message")

With cdoMessage
Set .Configuration = cdoConfig
.From = "<email>"
.To = "<email>"
.Subject = "Problem - " + strServer
.TextBody = "Agent "
.Send
End With

Set cdoMessage = Nothing
Set cdoConfig = Nothing
Nov 21 '06 #1
3 4374
sashi
1,754 Expert 1GB
Hi,

I am trying to use the below to send an email in a vbscript file...but am fairly unfamilar with vbscript.

It works fine until i put in the line to get the server name -
strServer = Request.ServerVariables("SERVER_NAME")

What is wrong...and what should i use to get the server name

Thanks

-------------------------------------



sch = "http://schemas.microsoft.com/cdo/configuration/"

strServer = Request.ServerVariables("SERVER_NAME"))

Set cdoConfig = CreateObject("CDO.Configuration")

With cdoConfig.Fields
.Item(sch & "sendusing") = 2 ' cdoSendUsingPort
.Item(sch & "smtpserver") = "<mailserver>"
.update
End With


Set cdoMessage = CreateObject("CDO.Message")

With cdoMessage
Set .Configuration = cdoConfig
.From = "<email>"
.To = "<email>"
.Subject = "Problem - " + strServer
.TextBody = "Agent "
.Send
End With

Set cdoMessage = Nothing
Set cdoConfig = Nothing
Hi there,

What is the error message as well as the error number / code being prompt?
Nov 21 '06 #2
It gives the error - object required: 'Request'

on the server request line - Request.ServerVariables("SERVER_NAME")

I need a vbscript file that i can put anywhere on the pc and click on it and it will run as below.
Currently the file sends the email fine but has problems with the server name when that line is added - is there a vbscript way to do this.



Hi there,

What is the error message as well as the error number / code being prompt?
Nov 21 '06 #3
sashi
1,754 Expert 1GB
It gives the error - object required: 'Request'

on the server request line - Request.ServerVariables("SERVER_NAME")

I need a vbscript file that i can put anywhere on the pc and click on it and it will run as below.
Currently the file sends the email fine but has problems with the server name when that line is added - is there a vbscript way to do this.
Hi there,

I see the problem now, look at the below code segment, it has an extra parenthesis, remove it.Hope it works, good luck & take care.

Expand|Select|Wrap|Line Numbers
  1. strServer = Request.ServerVariables("SERVER_NAME"))
  2.  
Nov 21 '06 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Jane | last post by:
Hello, I get the error Error Occured Reading Records: Server has not yet been opened. when I am trying to view a report using the asp pages for crystal reports. It works fine for access files....
1
by: jane | last post by:
I use following code to create a Crystal Report by connecting to an access db in ASP. It works fine. Now I switch to SQL Server and it doesn't work. It seems to me there is nowhere I can add login...
9
by: Kathryn | last post by:
Hiya I have a problem with using some client side and server side scripting together in an ASP. I'm using VBScript. What I'm trying to achieve is this - - Page loads up and some server side...
3
by: Mick Turner | last post by:
I have connected to SQL Server database (server-side vbscript) and read some data from the tables. This works correctly. I now have the data in an array (server-side). I have to draw a...
6
by: Andy Wawa | last post by:
Hi, on a simple HTML (not an ASP!)-Site I try to connect to a sql server (MS): <html> <title>Test</title> <head> <script language="javascript"> <!-- Function showForm(){
7
by: MyndPhlyp | last post by:
I am building up a library of Class'es that represent various columns of table layouts. One often used column is "name" and each occurrence is treated identically. (What a concept, eh?) Part of...
4
by: Glenn M | last post by:
I have a shared XML file on a server . i also have one xslt file that performs a simple transform on in to view the data. now i want to have another page that lets users modify the shared xml...
7
by: skeddy | last post by:
In a nutshell, I'm trying to dynamically create a select box with ResultSet code in vbscript and then need to be able to access the value of that select box later with a Save button. I've got...
3
by: axelman | last post by:
Hi guys, I'm using Classic ASP, IIS6, IE 7, FF 3 I've developed a vb script to downloand files hosted in my server (zip, doc, pdf, jpg, xls, et. etc.) it's very straight forward and there's a ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.