|
-
Oct 16th, 2001, 07:24 PM
#1
Thread Starter
Hyperactive Member
Need *.vbs script help, about mailing...
I need to create a *.vbs file which sends a mail to a predefined adress (or adress list) when i click on it...
I got this script by reading a lot of example scripts, but it doesn't work..... Can anyone provide such a script...
No buttons no forms... playinly written in a text editor..
So when i double click it , it sends itself to an predefined adress
the body of the mail will be drawn from a file which changes every day (log file) and the mail must be sendt by simply doubleclicking it... lets call it mail.vbs
Can anyone help me out here
(or do i have to mail the ILOVEYOU.vbs creator(bad man) to get help)
Well...talk to me if you know some code that can help me with sending mail from an *.vbs file
(attachemnt: the code i have so far...not working)
***************
Please use [highlight=vb] ..your code.. [/highlight] when posting code!
When you have received the working answer to your question,
please mark it as *SOLVED* + Your Questions Title ...using your Thread's Tool menu.
Also try to point out what answer made it work for you, or edit your first post to contain a quote of the correct answer...
Please Answer All Questions With Working Code Examples...
My Unfinished Projects and My working Programs
***************
-
Oct 17th, 2001, 03:56 AM
#2
Fanatic Member
Try this....................
Dim objMail
Set objMail = Server.CreateObject("CDONTS.NewMail")
objMail.From = "[email protected]"
objMail.Subject = "A message TO you"
objMail.AttachFile("c:\temp\" "name of file")
objMail.To = "[email protected]"
objMail.Body = "New Email"
objMail.Send
Response.write("Mail was Sent")
'You must always do this with CDONTS.
set objMail = nothing
The Italic part is if you need to attach something to the email.. Other wise just change the parts that you need to (the email address.. (there is a way of checking the email address the user put in but I can't remember how.... )
But I hope that this helps a bit on getting in the right way!
-
Oct 17th, 2001, 04:49 AM
#3
Thread Starter
Hyperactive Member
Well..this code required some "server"
Got the error message "need object "server"
and it was pointing to the CDots.line (line 2 of your code)
So my question is? do you use win2000 or winNT and/or do you run a server on your machine? (asp/php) server?
Cause i run winME and have understood that the code migth
only run under win2000 as it has a built in server...
Do you know how to access SMTP engine?
well...ofcourse, through *.vbs code.....?
***************
Please use [highlight=vb] ..your code.. [/highlight] when posting code!
When you have received the working answer to your question,
please mark it as *SOLVED* + Your Questions Title ...using your Thread's Tool menu.
Also try to point out what answer made it work for you, or edit your first post to contain a quote of the correct answer...
Please Answer All Questions With Working Code Examples...
My Unfinished Projects and My working Programs
***************
-
Oct 17th, 2001, 05:43 AM
#4
Fanatic Member
Oh... The machine is a Win2000... Sorry.. That worked for me though it is sitting on a Win2000 Server...
I am sure that someone will come to you with the correct answer.. But I think that it was on the correct line...
-
Oct 17th, 2001, 04:35 PM
#5
Thread Starter
Hyperactive Member
im thankfull for your help...
And im sure the scripts works very well on win2k
But my problem is that im running PWS on winME (&98)
and that it doesnt support CDONTS ...
But maybe i will install win2k soon....
since it has some advantages...
Very helpfull for your reply...and hope you can dig up omething about SMTP if you know where to find info on it...
Do you know how to "connect" a script
to a application which is running...
(EX: i have a script,which starts notepad, then the script,input text to the notepad application)
Do you know how to do something like that?
***************
Please use [highlight=vb] ..your code.. [/highlight] when posting code!
When you have received the working answer to your question,
please mark it as *SOLVED* + Your Questions Title ...using your Thread's Tool menu.
Also try to point out what answer made it work for you, or edit your first post to contain a quote of the correct answer...
Please Answer All Questions With Working Code Examples...
My Unfinished Projects and My working Programs
***************
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|