Computer Forums

Member Login

Remember Me? Sign Up! | Forgot Password
 
Slogan
 
Closed Thread
Old 04-09-2009, 01:37 PM   #1 (permalink)
 
Newb Techie

Join Date: Feb 2009

Posts: 20

benny237 is on a distinguished road

Default activeX email question

I would like to write an activeX script for a button . . .

when the user presses that button it automatically sends an email to a specified email address. . .the user does not have to press anything except for the web button . . .

var ax = new ActiveXObject("WScript.Network");
document.write("Username: ");
document.write(ax.UserName + '<br />');
document.write("Computer Name: ");
document.write(ax.ComputerName + '<br />');
document.write("Domain Name: ");
document.write(ax.UserDomain + '<br />');


above is code I am using to extrapolate the username and computername . . .

what I still would like to do . . .



is there anyway to get the ip address of the computer??

also, how would I send all of this data in an email to the helpdesk mailbox??

PLEASE, any help is greatly appreciated!!
benny237 is offline  
Old 04-11-2009, 12:52 PM   #2 (permalink)
office politics's Avatar
 
It's all just 1s and 0s

Join Date: Jan 2004

Location: in the lab

Posts: 4,410

office politics will become famous soon enough

Default Re: activeX email question

Obtaining Your Visitor's IP Address
office politics is offline  
Old 04-13-2009, 11:47 AM   #3 (permalink)
 
Newb Techie

Join Date: Feb 2009

Posts: 20

benny237 is on a distinguished road

Default Re: activeX email question

no help from that one office politics . . .

I am using an activex script right now that gives user name, domain, and computer name. . .

what would I add to it to give ip address, and also email that information to a specified source?

var ax = new ActiveXObject("WScript.Network");
document.write("Username: ");
document.write(ax.UserName + '<br />');
document.write("Computer Name: ");
document.write(ax.ComputerName + '<br />');
document.write("Domain Name: ");
document.write(ax.UserDomain + '<br />');
benny237 is offline  
Old 04-13-2009, 04:22 PM   #4 (permalink)
office politics's Avatar
 
It's all just 1s and 0s

Join Date: Jan 2004

Location: in the lab

Posts: 4,410

office politics will become famous soon enough

Default Re: activeX email question

actually what you're doing is creating a wshnetwork object in javascript code and showing properties of that object to the user.

WSH » Objects » wshnetwork - DevGuru Quick Reference

ActiveXObject Object



you really want to use server side code to complete this task because the server will always show the public ip given by the isp as opposed to the private ip given by the home router or set by the user.
office politics is offline  
Old 04-16-2009, 09:31 AM   #5 (permalink)
 
Newb Techie

Join Date: Feb 2009

Posts: 20

benny237 is on a distinguished road

Default Re: activeX email question

office politics -

the data that I have all ready generated is exactly what I need . . . now the question is, whether I can automatically send these three lines of data in an email . . .

any idea how to do this?
benny237 is offline  
Old 04-17-2009, 05:06 PM   #6 (permalink)
office politics's Avatar
 
It's all just 1s and 0s

Join Date: Jan 2004

Location: in the lab

Posts: 4,410

office politics will become famous soon enough

Default Re: activeX email question

here's some code for 2000/xp. vista hasn't been tested.

you need to change the smtp server and email addresses

it's vbscript.



Code:


Set objEmail = CreateObject("CDO.Message")

objEmail.From = "from@email.com"
objEmail.To = "to@email.com"

objEmail.Subject = "subject text" 



ax = createObject("WScript.Network");
txt = "Username: ")
txt = txt & ax.UserName & "<br />"
txt = txt & "Computer Name: "
txt = txt & ax.ComputerName & '<br />"
txt = txt & "Domain Name: "
txt = txt & ax.UserDomain & '<br />"



objEmail.htmlbody = txt
                    

objEmail.Configuration.Fields.Item _
    ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
objEmail.Configuration.Fields.Item _
    ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = _
        "smtp.server.com" 
objEmail.Configuration.Fields.Item _
    ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
objEmail.Configuration.Fields.Update

'for each i in list

  'msgbox i

  'objEmail.AddAttachment i

'next

'objEmail.AddAttachment wshshell.currentdirectory & "\" & logf

objEmail.Send
  
  'msgbox "sent."

office politics is offline  
 
Closed Thread

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Access Multiple Email Accounts with Gmail in 3 Easy Steps MDeCarlo Articles 11 03-08-2009 02:42 PM
Google's email service down Osiris Browser & General Internet Questions 3 02-25-2009 02:22 AM
Poaching Email GolferV Windows Operating Systems and Software 8 08-22-2008 12:40 PM
Little bit of email server advice / help Oblit3ration Browser & General Internet Questions 4 08-12-2008 06:32 AM
girl in peril! needs email bounceback advice! :'( FoxeiRoxei Windows Operating Systems and Software 5 07-31-2008 01:23 PM