Solved

VBScript Problem

Posted on 2004-09-10
10
355 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
Report: Liquid Web beats Amazon, Rackspace & More

A study by performance analyst firm Cloud Spectator finds that Liquid Web beats rivals Amazon, Rackspace and DigitalOcean when it comes to website and cloud application performance.

 

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
 
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

Is Your DevOps Pipeline Leaking?

Is your CI/CD pipeline a hodge-podge of randomly connected tools? You’ve likely got a tool to fix one problem & then a different tool to fix another, resulting in a cluster of tools with overlapping functionality. Learn how to optimize your pipeline with Gartner's recommendations

Question has a verified solution.

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

Suggested Solutions

Any business that wants to seriously grow needs to keep the needs and desires of an international audience of their websites in mind. Making a website friendly to international users isn’t prohibitively expensive and can provide an incredible return…
CTAs encourage people to do something specific to show interest in your company, product or service. Keep reading to learn why CTAs should always be thought of as extremely important, albeit small, sections of websites.
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

734 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