Shoutbox

Send mail when contact logs in - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4)
+---- Forum: Scripting (/forumdisplay.php?fid=39)
+----- Thread: Send mail when contact logs in (/showthread.php?tid=98304)

Send mail when contact logs in by tosjowner on 09-11-2011 at 12:02 PM

Hello everyone,
I'm kinda new to this forum, but i really would like to program some scripts.

I was wondering if someone has a scipt that sends an email  when a contact logs in.
If you could send me a script that does something like that, i should really appreciate it!

Tosjowner

-edit-
It doesn't actually have to be an e-mail, but i just want to get a notification on my iPod, so when a specific contact comes online, i'll get a notification on my iPod.
i don't care in what way, the easiest will do. (I.e.; twitter, skype, mail, or whatever!)


RE: Send mail when contact logs in by matty on 12-09-2011 at 08:04 PM

This would work but would require you to have a GMail account.

Javascript code:
function OnEvent_ContactSignin(strEmail) {
    if (strEmail === 'mygirlfriend@hotmail.com')
        SendMail(strEmail, 'Online');
}
 
function SendMail(strEmail, strStatus) {
    var strFromEmail        = 'joesmith@gmail.com';
    var strPassword         = 'Testing01!';
    var oEmail              = new ActiveXObject('CDO.Message');
    oEmail.From             = strFromEmail;
    oEmail.To               = 'johnsmith@hotmail.com';
    oEmail.Subject          = 'Contact status is now: '+strStatus;
    oEmail.TextBody         = strEmail+' status is now: '+strStatus;
   
    var oEmailConfig        = oEmail.Configuration;
    with (oEmailConfig) {
        Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver")         = 'smtp.gmail.com';
        Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport")     = 465;
        Fields("http://schemas.microsoft.com/cdo/configuration/sendusing")          = 2;
        Fields("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate")   = 1;
        Fields("http://schemas.microsoft.com/cdo/configuration/smtpusessl")         = true;
        Fields("http://schemas.microsoft.com/cdo/configuration/sendusername")       = strFromEmail;
        Fields("http://schemas.microsoft.com/cdo/configuration/sendpassword")       = strPassword;
       
        Fields.Update;
    }
    oEmail.Send;
}


RE: Send mail when contact logs in by CookieRevised on 12-09-2011 at 11:53 PM

Note:
Using the method outlined by matty (CDOSYS), you can use whatever SMTP server you want, not just GMail...
of course you need to have a login and pwd on that smtp server though, and set the appropiate port variable....


PS: in case you have a (windows) hosting somewhere, chances are they also have an SMTP server; in most cases you can use that one too.