Solved

VBScript Problem

Posted on 2004-09-10
10
351 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
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 

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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Suggested Solutions

Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
"In order to have an organized way for empathy mapping, we rely on a psychological model and trying to model it in a simple way, so we will split the board to three section for each persona and a scenario and try to see what those personas would Do,…
Viewers will get an overview of the benefits and risks of using Bitcoin to accept payments. What Bitcoin is: Legality: Risks: Benefits: Which businesses are best suited?: Other things you should know: How to get started:
This tutorial walks through the best practices in adding a local business to Google Maps including how to properly search for duplicates, marker placement, and inputing business details. Login to your Google Account, then search for "Google Mapmaker…

856 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