Solved

VBScript Problem

Posted on 2004-09-10
10
343 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
How do I move it over so it's Server Side scripting?
0
 
LVL 3

Expert Comment

by:andYetAnotherLoginName
Comment Utility
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 16

Expert Comment

by:OliWarner
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Hi,

Would you be so kind respond to the suggestions?
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
Read about why website design really matters in today's demanding market.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to dynamically set the form action using jQuery.

772 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

11 Experts available now in Live!

Get 1:1 Help Now