Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

VBScript Problem

Posted on 2004-09-10
10
Medium Priority
?
369 Views
Last Modified: 2008-03-10
When I run the VBScript listed below from Windows Explorer (C:\Inetpub\GWNLtd\emailSendMail.html) it works fine and sends the test email.  If I run the script using the fully qualified web address (http://www.gwnlimited.com/emailSendMail.html) I get the following error message:

Line: 4:
Char: 1
Error: ActiveX component can't create object: 'MailServerX.AddressItem'
Code: 0
URL: http://www.gwnlimited.com/emailSendMail.html


Can anyone help?  VBScript listing below.

<SCRIPT LANGUAGE="VBScript">

Dim Sender, Recipients, CC, Body, Attachments, MailMessage
set Sender=CreateObject("MailServerX.AddressItem")
Sender.Name="Digby Matthew Walsh"
Sender.Address="Good@walsh.ac"

'To headers
set Recipients=CreateObject("MailServerX.AddressList")
Recipients.AddAddress "matt@walsh.ac","Scott"


'Create message body
set body=CreateObject("MailServerX.Lines")
body.add "Hello"
body.add "Goodbye"

set MailMessage=CreateObject("MailServerX.MailMessage")
MailMessage.From=Sender
MailMessage.ToRcpt=Recipients
MailMessage.Subject="Order Status Request"
MailMessage.body=body

'Create SendMail object
dim SendMail
set SendMail=CreateObject("MailServerX.SendMail")

'Assign the message
SendMail.MailMessage=MailMessage

'and send it
SendMail.PutToOutBox

MsgBox(" .............. Thanks! Message Sent!")

</SCRIPT>

0
Comment
Question by:mattyswalsh
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
  • +2
10 Comments
 
LVL 16

Expert Comment

by:OliWarner
ID: 12025283
It means you've got the MailServerX component registered locally, but not on your host.
This is also client side scripting... you want to move it over so its server side...

so you'll end up making a ASP page, with the same scripting
0
 
LVL 3

Expert Comment

by:andYetAnotherLoginName
ID: 12025342
Error: ActiveX component can't create object: 'MailServerX.AddressItem'
URL: http://www.gwnlimited.com/emailSendMail.html

internet pages are subject to stricter security settings, that, obviously, do not allow you to create ActiveX. you could force your users to go and change all these security settings, but, come on - it is real hassle that nobody wants to do, so, in the end, your REAL options are 1) mailto: url, 2) mailing forms, and 3) server-side scripting.

0
 
LVL 16

Expert Comment

by:OliWarner
ID: 12025405
not only that all client would have to install the directx package...
this is why things must be done server side through ASP
0
Understanding Web Applications

Without even knowing it, most of us are using web applications on a daily basis. Gmail and Yahoo email, Twitter, Facebook, and eBay are used by most of us daily—and they are web applications. We often confuse these web applications tools for websites.  So, what is the difference?

 

Author Comment

by:mattyswalsh
ID: 12025414
How do I move it over so it's Server Side scripting?
0
 
LVL 16

Expert Comment

by:OliWarner
ID: 12025456
learn some ASP for a start... ASP is just VB script so most of this should work... you also need to make sure your server supports ASP... IIS is the only one with directx capabilities...

www.asp101.com is a good place to learn the differences
the MailServerX website should also have some ASP examples on
0
 
LVL 1

Expert Comment

by:findajay
ID: 12025879
Hi  mattyswalsh,

You just have to change your internet explorer security settings for this script to run. The code is in VBScript, that means it is going to be executed in client system. As this code is already working fine when executed locally that means that component is installed properly in our system.
For changing the security settings.
In IE go to Tools -> Iternet Options from menubar
Select Security tab
Under ActiveX Controls and Plug Ins, you check all the options as Enable.
This should solve your problem.

Enjoy!!!
0
 

Author Comment

by:mattyswalsh
ID: 12028435
Hello Findajay,

Thanks, but this means anyone running the script will have to reduce the activex security settings.  Do you know a way I can run the script on the server side?
0
 
LVL 10

Expert Comment

by:avidya
ID: 12031145
Hi Matty,

See this answer, it will provide you with links and working example code :
http://www.experts-exchange.com/Web/Q_21074735.html
0
 
LVL 10

Accepted Solution

by:
avidya earned 1500 total points
ID: 12115573
Hi,

Would you be so kind respond to the suggestions?
0

Featured Post

Plesk WordPress Toolkit

Plesk's WordPress Toolkit allows server administrators, resellers and customers to manage their WordPress instances, enabling a variety of development workflows for WordPress admins of all skill levels, from beginners to pros.

See why 2/3 of Plesk servers use it.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Dramatic changes are revolutionizing how we build and use technology. Every company is automating, digitizing, and modernizing operations. We need a better, more connected way to work together as teams so we can harness the insights from our system…
When the s#!t hits the fan, you don’t have time to look up who’s on call, draft emails, call collaborators, or send text messages. An instant chat window is definitely the way to go, especially one like HipChat. HipChat is a true business app. An…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).
The is a quite short video tutorial. In this video, I'm going to show you how to create self-host WordPress blog with free hosting service.
Suggested Courses

604 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question