Results 1 to 18 of 18

Thread: SendEmail

  1. #1
    Join Date
    Jan 2012
    Posts
    1,596
    Mentioned
    78 Post(s)
    Quoted
    826 Post(s)

    Default SendEmail

    Thanks to work by my friend OrangeCrush (https://github.com/OrangeCrush), I have been able to make this little function.
    Also, John for the original idea on this.

    Most of the credit goes to OrangeCrush because hes the one who helped with the anti-login portion, made the anti-spam portion, and interfaced/setup everything. It uses NodeMailer by andris9 to send the mail.

    What does it do?
    Well, it allows for you to send an email to a specific address. Its pretty neat.

    What can I use this for?
    For any number of things included but not limited to: errors, level up notifications, etc.
    Main usage -- SMS Text Messages to mobile phones. Check here to find out how to text you phone.

    What can't I use this for?
    Spam and sending people's login info (server has spam checks and some login checks)

    Can I have the source code for the actual code that sends the mail?
    Short answer: No (pm me and i may let you in on the secret)
    Unfortunately, I cant release the source from the actual web portion of this as (1) I have no idea how it works or how to get the actual source files and (2) then everyone would be able to see the anti-login information portion and then it could easily be bypassed. (if you'd really like it I can look into getting this)

    Actual Function:
    Simba Code:
    Procedure SendEmail( address, message : String );
    var
      x : Integer;
      sBuff, SafeMask : String;
    Begin
    //-----Message/URL Encoding---Written by BenJones on lazarus.freepascal.org-----
      SafeMask := '0123456789abcdefghijklmnopqrstuvwxyz*@._-';
      sBuff := '';
      For x := 1 to Length(message) Do  //Iterate over the entire string
      Begin        //Check if we have a safe char
        If (pos(message[x], SafeMask) > 0) Then sBuff := sBuff + message[x]
        Else If (message[x] = ' ') Then sBuff := sBuff + '+' //Append space
        Else sBuff := sBuff + '%' + IntToHex(Ord(message[x])); //Convert to hex
      End;
    //----End URL Encode------------------------------------------------------------
      If GetPage('http://webhost1.hp.af.cm/path?a=' + address +
                 '&m=' + sBuff) = '' Then
        WriteLn('Attempted to send "' + message + '" to ' + address +
                ', but we were unable to reach the webhost to send it')
      Else
        WriteLn('"' + message + '" sent to ' + address)
    End;

    Usage:
    Simba Code:
    .
    SendEmail('email@email.com','Your Bot has encountered an error');
    .

    and if you want to just write your own function, but still use the online sendmail portion of this, youll need this URL:
    Code:
    http://webhost1.hp.af.cm/path?a=ADDRESS&m=MESSAGE
    Note: Remember to encode your text to URL friendly text, ie SPACE needs to be written %20.
    Last edited by Turpinator; 02-25-2013 at 07:07 PM.

  2. #2
    Join Date
    Mar 2007
    Posts
    5,125
    Mentioned
    275 Post(s)
    Quoted
    901 Post(s)

    Default

    Would be good if you could post the php source as we are a open-source community.

    Forum account issues? Please send me a PM

  3. #3
    Join Date
    Jan 2012
    Posts
    1,596
    Mentioned
    78 Post(s)
    Quoted
    826 Post(s)

    Default

    Quote Originally Posted by Justin View Post
    Would be good if you could post the php source as we are a open-source community.
    But then the login info detection could easily be bypassed.

    OrangeCrush said the online portion of it was also added to his Hermes project (https://github.com/OrangeCrush/hermes)

  4. #4
    Join Date
    Nov 2012
    Posts
    2,351
    Mentioned
    55 Post(s)
    Quoted
    603 Post(s)

    Default

    Quote Originally Posted by Turpinator View Post
    But then the login info detection could easily be bypassed.

    OrangeCrush said the online portion of it was also added to his Hermes project (https://github.com/OrangeCrush/hermes)
    If u randomized letters (basic encrypt decrypt concept) and removed @ symbols etc, how could it tell anyway? Bad idea imo, even worse unless you make it open source


    Programming is like trying keep a wall of shifting sand up, you fix one thing but somewhere else starts crumbling

  5. #5
    Join Date
    Jan 2012
    Posts
    1,596
    Mentioned
    78 Post(s)
    Quoted
    826 Post(s)

    Default

    Quote Originally Posted by DannyRS View Post
    If u randomized letters (basic encrypt decrypt concept) and removed @ symbols etc, how could it tell anyway? Bad idea imo, even worse unless you make it open source
    Already thought about that and if someone goes through the trouble to encrypt and decrypt someones' login info, then they should have enough knowledge to get a php mailer script uploaded and they wouldnt need this in the first place.
    This is just for those who either dont have time or dont have enough knowledge do make a php mailer script.

  6. #6
    Join Date
    Jan 2011
    Location
    Denver, CO
    Posts
    1,351
    Mentioned
    2 Post(s)
    Quoted
    72 Post(s)

    Default

    It would be better if this was done completely in Simba.

  7. #7
    Join Date
    Mar 2007
    Posts
    5,125
    Mentioned
    275 Post(s)
    Quoted
    901 Post(s)

    Default

    Why use a gmail account when you can use the php mail() function?

    Forum account issues? Please send me a PM

  8. #8
    Join Date
    Jan 2012
    Posts
    1,596
    Mentioned
    78 Post(s)
    Quoted
    826 Post(s)

    Default

    Quote Originally Posted by Justin View Post
    Why use a gmail account when you can use the php mail() function?
    php mail() gets blocked by spam filters sometimes. (according to my friend)
    and i had just asked him to make/setup some sort of online mailer because i dont have the knowledge/motivation to make one.
    Last edited by Turpinator; 01-11-2013 at 04:40 AM.

  9. #9
    Join Date
    Oct 2011
    Location
    Australia, Vic
    Posts
    1,517
    Mentioned
    2 Post(s)
    Quoted
    120 Post(s)

    Default

    Good work


    I have mine finished, It does basically the same stuff but is more Simple, PM me if you want to see the code.

  10. #10
    Join Date
    Oct 2008
    Location
    C:\Simba\Includes\
    Posts
    7,566
    Mentioned
    19 Post(s)
    Quoted
    180 Post(s)

    Default

    The only reason why mail gets blocked by spam filters is the content or the IP of the sender. Not because of the mail() function.
    Away for awhile, life is keeping me busy. | Want to get my attention in a thread? @Kyle Undefined; me.
    { MSI Phoenix || SRL Stats Sigs || Paste || Scripts || Quotes || Graphics }

    When posting a bug, please post debug! Help us, help you!

    I would love to change the world, but they won't give me the source code. || To be the best, you've got to beat the rest. || Logic never changes, just the syntax.
    If you PM me with a stupid question or one listed in FAQ, or about a script that is not mine, I will NOT respond.


    SRL is a Library of routines made by the SRL community written for the Program Simba. We produce Scripts for the game Runescape.


  11. #11
    Join Date
    Jun 2007
    Posts
    7
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    On your webhost you can setup a simple PHP file to send your emails.

    mailme.php?email=a@a.com&r=itisme44&message=yourme ssage
    <?php
    $randomstring=$_GET['r'];
    if ($randomstring=='itisme44'){
    $email=$_GET['email']; //or hard code your email
    $message = $_GET['message'];
    mail($email,"Its Me, Your Bot", $message);
    }
    ?>

  12. #12
    Join Date
    May 2007
    Posts
    527
    Mentioned
    12 Post(s)
    Quoted
    109 Post(s)

    Default

    Or even better, you could use PHPMailer!

  13. #13
    Join Date
    Feb 2007
    Location
    Colorado, USA
    Posts
    3,716
    Mentioned
    51 Post(s)
    Quoted
    624 Post(s)

    Default

    Quote Originally Posted by Turpinator View Post
    php mail() gets blocked by spam filters sometimes. (according to my friend)
    and i had just asked him to make/setup some sort of online mailer because i dont have the knowledge/motivation to make one.
    more like all the time, especially if it isn't a white listed mail server

    php mail() uses the same thing, all mail servers use.. it's just the php function for it. I like smtp using google is much better and faster in most cases.

    I think it is a pretty cool idea, just to go along with the topic all phones have an email address associated with them, it's like your phone number-etc@phoneprovider.whatever

    I had an idea for an automated way to find it, but too much work on the carrier email parts, it finds out what the phone number belongs to and gets that email.. I had a script years ago that I could email my server and it would text(email my phone) back and give me the weather for whatever zip code I emailed it.. it was before smartphones were so popular (even today I don't have a smartphone, I guess I just don't care about the weather as much because I don't go outside anymore) anyway there are lots of cool uses for the phone email if the user only has text capabilities and no internet and even if they do

    I think it's pretty cool that you added it for simba, maybe in the future if 2007scape never gets updated and we got bots for everything in existence we can make a script that does multiple things like woodcutting, combat, fire making etc and you can text it and tell it what to do, so it switches to different tasks whenever you say
    The only true authority stems from knowledge, not from position.

    You can contact me via matrix protocol: @grats:grats.win or you can email me at the same domain, any user/email address.

  14. #14
    Join Date
    Feb 2012
    Location
    DON'T PM ME ASKING FOR STUFF
    Posts
    2,170
    Mentioned
    38 Post(s)
    Quoted
    423 Post(s)

    Default

    I'm pretty sure I explained this to John?

    Anyway gz on release

  15. #15
    Join Date
    Jan 2012
    Posts
    1,596
    Mentioned
    78 Post(s)
    Quoted
    826 Post(s)

    Default

    Quote Originally Posted by xtrapsp View Post
    I'm pretty sure I explained this to John?

    Anyway gz on release
    This was at the same time John had asked you about it probably. He had came to me because of a player owned port timer i had made that sent text/email messages and wanted to know about script implementation.

    While this 'snippet' doesnt really even use simba to send the email (except encoding it which i dont think is even required), and its not really something that would be added to SRL, it was really for my use/John's and i decided i would post it for anyone else who might want to add email notifications with little to no effort.

  16. #16
    Join Date
    Oct 2011
    Location
    Australia, Vic
    Posts
    1,517
    Mentioned
    2 Post(s)
    Quoted
    120 Post(s)

    Default

    Mine just goes to a url on my site with your email and what you want it to say and the page sends the message to your email.

    It's a simple GetPage();

  17. #17
    Join Date
    Jan 2011
    Location
    Denver, CO
    Posts
    1,351
    Mentioned
    2 Post(s)
    Quoted
    72 Post(s)

    Default

    This could be done completely in Simba if we had access to the Synapse library already included for functions like GetPage and etc. I tried to do this just using sockets at one point but had no way of initializing a TLS session (which GMail and other mail providers require).

  18. #18
    Join Date
    Sep 2007
    Location
    Australia, NSW
    Posts
    934
    Mentioned
    6 Post(s)
    Quoted
    145 Post(s)

    Default

    For SRL Members, there's a tut on our upper boards (really really old) that still works I'm using it now. You can use it to send messages from Simba to an email. Unfortunately, it requires php - the code is all open-source:

    http://villavu.com/forum/showthread.php?t=47589

    INACTIVE
    How-to: Make S.M.A.R.T. less laggy

    Sell me your Maple Shieldbows (u)! Up to 95gp ea!

    My Scripts:
    Ivy Chopper Ultra [RS3] | Fantastic Fletcher [RS3]
    99 x78 | 99 x10 | 99 x2 | 99 x12


    Use the REPORT tags when posting progress reports to make life easier (:
    [REPORT]Put progress report in here![/REPORT]

    Super Savvy Smither V1.06Cool Classy Cooker V1.02 [EoC]

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •