mIRC Home    About    Download    Register    News    Help

Print Thread
Scripting email Alerts #80406 24/04/04 03:53 AM
Joined: Dec 2002
Posts: 99
M
MDA Offline OP
Babel fish
OP Offline
Babel fish
M
Joined: Dec 2002
Posts: 99
Greetings,

I'm needing to email our staff when there is a possible alert triggered from a hacking or flooding incident in one of our mIRC based chatrooms.

In the alias section I have this:

alert.email {
run mailto:chatstaff@charter.net?Subject=Flooding Alert in Such and Such }

This automatically brings up our email browser with the To and Subject correctly filled in.

I can't figure out how to automatically paste information into the body of the email, nor how to send the Alt-S command to send that email off.

Thanks for your help and consideration,
Regards,
MDA

Re: Scripting email Alerts #80407 24/04/04 03:58 AM
Joined: Dec 2002
Posts: 1,527
L
landonsandor Offline
Hoopy frood
Offline
Hoopy frood
L
Joined: Dec 2002
Posts: 1,527
going from a LOUSY memory (untested):

alert.email {
run mailto:chatstaff@charter.net?Subject=Flooding Alert in Such and Such?Body=Fill in your stuff here }


Those who fail history are doomed to repeat it
Re: Scripting email Alerts #80408 24/04/04 04:02 AM
Joined: Dec 2002
Posts: 99
M
MDA Offline OP
Babel fish
OP Offline
Babel fish
M
Joined: Dec 2002
Posts: 99
Greetings,

Yes apparently the command line variables are the following:
mailto:<to e-mail>?cc=<cc email>&bcc=<bcc mail>&subject=<subject text>&body=<body text>

How do I send the Alt-S command to send that now filled in email off automatically however?

Regards,
MDA

Re: Scripting email Alerts #80409 24/04/04 04:07 AM
Joined: Dec 2002
Posts: 1,527
L
landonsandor Offline
Hoopy frood
Offline
Hoopy frood
L
Joined: Dec 2002
Posts: 1,527
sorry but tat's out of my league confused Wish I could help ya further


Those who fail history are doomed to repeat it
Re: Scripting email Alerts #80410 24/04/04 10:43 AM
Joined: Aug 2003
Posts: 1,831
I
Iori Offline
Hoopy frood
Offline
Hoopy frood
I
Joined: Aug 2003
Posts: 1,831
Maybe with Sendkeys.

Re: Scripting email Alerts #80411 25/04/04 03:07 AM
Joined: Dec 2002
Posts: 99
M
MDA Offline OP
Babel fish
OP Offline
Babel fish
M
Joined: Dec 2002
Posts: 99
Greetings and my special thanks to Landonsandor and Iori,

To successfully remote mIRC script Email Flooding and Hacker Alerts to our remote staff members, we have successfully implemented and are using the following using mIRC, the Outlook Express Email browser, Outlook Express Command line features, and the Windows SendKey Shell.

The same technique could apply to any mIRC scripting application in which a trigger would begin the following sequence where you wanted to automatically generate and send a email about a given triggered mIRC event.

Note: For Outlook Express, the shortcut key to Send a email document is Alt-s and other email browsers could well use a different keystroke combination which would reflect in minor changes in your file.wsf

Alias routine and .wsf file needed are:

Alias mass.emailflood1

In the Alias Section we've added this:

mass.emailflood1 { run mailto:Someone@charter.net?cc=SomeoneElse@charter.net&bcc=AnoterPerson@hotmail.com&subject=Flooding Alert&body=A Flooding Alert was Issued from Whatever Name chatroom at $time(hTT) $day on $adate | /run C:\1Report/alt-s.wsf }

Adding the Windows SendKey Shell

alt-s.wsf file creation steps:

In the C drive 1Report folder using either Windows NotePad (save as a .txt file then rename as a .wsf file format) or NotePad Plus (save as a .wsf file format) we simply entered the following and named it alt-s.wsf

<job id="js">
<script language="JScript">
var WshShell = WScript.CreateObject("WScript.Shell");
WshShell.SendKeys ("{TAB}");
WshShell.SendKeys ("{TAB}");
WshShell.SendKeys ("{TAB}");
WshShell.SendKeys ("{TAB}");
WshShell.SendKeys ("%(s)");
</script>
</job>

Note: The 4 Tab strokes were needed for us to move the cursor into the body of the email text, once there we automatically initiated the Alt-s command ("%(s)"); which then automatically sends that email out to our staff members. This folder 1Report is of course specific to our needs and is changed as is the hard drive designation on your specific system, the name of the resulting Windows SendKey Shell .wsf file we simply named to reflect its single function namely alt-s.wsf

Additional features regarding the Windows SendKey Shell can be found at this link:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/html/wsmthsendkeys.asp Windows SendKey Shell Information

Testing this new feature:

In a active channel window, simply enter the following:

/timer.test 1 1 /mass.emailflood1

If Nortons or another anti-virus software program halts this specific .wsf file from implementation, simply verify that specific script is safe to use. That doesn't tell Norton's Anti Virus software its OK for other similar scripts to run, just that specific one, if you change your resulting alt-s.wsf then Norton's or another possible anti-virus email protector will again ask you if you wish to add that to its safe list or not.

Again our thanks and best regards to Landonsandor,Iori,the Author of mIRC and the many helpful folks here.

MDA

Re: Scripting email Alerts #80412 28/04/04 01:14 PM
Joined: Dec 2002
Posts: 1,321
H
Hammer Offline
Hoopy frood
Offline
Hoopy frood
H
Joined: Dec 2002
Posts: 1,321
Since you're using Outlook (Express), then depending on which operating system you're using, you can also script the entire thing using COM + CDONTS (or CDO).
  • .comopen cdoMessage CDO.Message
    !.echo -q $com(cdoMessage, Subject, 4, *bstr, Test message from # )
    !.echo -q $com(cdoMessage, Sender, 4, *bstr, your[/b]@[/b]email.com)
    !.echo -q $com(cdoMessage, To, 4, *bstr, your[/b]@[/b]email.com)
    !.echo -q $com(cdoMessage, TextBody, 4, *bstr, This is a test. Hope you like it!)
    !.echo -q $com(cdoMessage, Send, 1)
    .comclose cdoMessage
This method creates an email object, fills out whatever needs to be filled out and sends it using your Outlook Express settings.


DALnet: #HelpDesk and #m[color:#FF0000]IR[color:#EEEE00]C
Re: Scripting email Alerts #80413 28/04/04 03:00 PM
Joined: Nov 2003
Posts: 2,327
T
tidy_trax Offline
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,327
Quote:
!.echo -q $com(cdoMessage, Sender, 4, *bstr, your@email.com)


that allows you to use a different email to the one that's sending it?

i'm only asking because i wanted it for a channel bot, but i don't want everyone knowing my email address.


New username: hixxy
Re: Scripting email Alerts #80414 28/04/04 04:04 PM
Joined: Dec 2002
Posts: 1,321
H
Hammer Offline
Hoopy frood
Offline
Hoopy frood
H
Joined: Dec 2002
Posts: 1,321
That section of code was gleaned from something I typed into an editbox; I used it to send an email to myself, using my own email address in both places.

The .From property is usually used (and is the first property checked) and can contain a list of authors. If you don't fill in the .From property, then the .Send() method checks the .Sender property. (Note that NNTP - newsgroups - don't use the .Sender property at all.) All that being said, however, there is nothing that says you must use your own real email address in that field. Use it as the ReplyTo address you wish people to email you back with when they hit the Reply button.


DALnet: #HelpDesk and #m[color:#FF0000]IR[color:#EEEE00]C
Re: Scripting email Alerts #80415 28/04/04 04:17 PM
Joined: Nov 2003
Posts: 2,327
T
tidy_trax Offline
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,327
yeah, it didn't seem to work at all when i tried it.
(checked spam folders as well)


New username: hixxy
Re: Scripting email Alerts #80416 29/04/04 07:38 AM
Joined: Dec 2002
Posts: 99
M
MDA Offline OP
Babel fish
OP Offline
Babel fish
M
Joined: Dec 2002
Posts: 99
Greetings Hammer,

Thanks for your input on some new tools and commands to learn! I've quickly exhausted what appears to be a buffer limit on the outlook express command line, meaning what I had previously posted appears to work fine provided the email is a short post of about 300 characters or less otherwise it generates a unable to open error like this one:

run: unable to open 'mailto:someone@charter.net?cc=someone2@msn.com,another2@msn.com,yetanother@hotmail.com,them2@comcast.net,you2@hotmail.com&bcc=staff1@hotmail.com,staff2@hotmail.com,staff3@hotmail.com&subject=Daily Report for Chatroom number 5 at Talk City on Wednesday 04/28/2004 &body=5th Chatroom Name had 68 Visitors and 10 Hosts today and a Grand Total of 1657 for April in our Chatroom name chatroom at Talk City for Wednesday 04/28/2004 as of 11PM' (line 67, aliases.ini)

My thoughts are its a limit on the command line string length in Outlook Express, and not a error in mIRC's string handling codes. I compact the automated post alittle and it goes out fine, add some more email addys or body and it stops with the unable to open error.

Thanks Hammer for providing us with some additional tools, I'd like to extend our scripting of email alerts into more body and fuller detail than the skimpy ones we have now. They are very condensed but concise however I feel they would be even more valuable if they were fleshed out with the ability to have more information without the error being generated as noted above. I feel the more hosts that are aware of a hacking problem or potential chatroom flooder the better off we'll be in providing the best chat experience we can to our guests and visitors.

Regards,
MDA