Solved

VBScript Problem

Posted on 2004-09-10
10
344 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
  • 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
 

Author Comment

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

Expert Comment

by:andYetAnotherLoginName
ID: 12025449
0
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 
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 500 total points
ID: 12115573
Hi,

Would you be so kind respond to the suggestions?
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
API Soap Calls 4 90
Popup window in I.E. 8 50
How to redirect all users but me properly to another page with htaccess 2 47
Standard for Web Development 3 27
Problem to be resolved in this article Currently, development of website and web application can be done without writing thousands of lines of programming code by hand. Description This can be done through by using a open source framework such …
Developer portfolios can be a bit of an enigma—how do you present yourself to employers without burying them in lines of code?  A modern portfolio is more than just work samples, it’s also a statement of how you work.
The viewer will learn how to count occurrences of each item in an array.
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).

895 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now