SRL Archive - Help and Support

Help with mail function


Foundry

2014-03-24 21:52:43

So I have been working on an include of mine and I have hit a feature that requires me to know much more about sockets/php/whatever than I currently do. I am trying to implement a sort of two way communication between me and my bots using e-mail. I need a function that can send an e-mail and one that can read e-mail(or something similar to that). I intend to use it to respond to someone if they try to talk to me in-game while I am away. If someone could make the functions and explain them to me I can return the favor with a few months RS membership via Amazon (I got a gift card last Christmas that I never used).

If there is some guide I missed that covers what I am looking for then please link it. I don't have a problem learning myself, it's just hard to find a starting point right now for what I am trying to do. PM me for my Skype.

Threads I have looked at:
http://villavu.com/forum/showthread.php?t=94410&highlight=email
http://villavu.com/forum/showthread.php?t=95086&p=1157180#post1157180
http://villavu.com/forum/showthread.php?t=98172
others I haven't linked yet.

Brandon

2014-03-24 22:05:41

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


Problem is that if you want to use it with Gmail or Hotmail, you need SSL installed.

Foundry

2014-03-24 22:17:24

From: Brandon
http://villavu.com/forum/showthread.php?t=98172


Problem is that if you want to use it with Gmail or Hotmail, you need SSL installed.


Yeah, I checked this out yesterday. I read it, understood like 20% of it, and tested to see if it would compile. Got this:

Exception in Script: Unknown declaration "SplitRegExpr" at line 63, column 3

Sk1nyNerd

2014-03-24 23:16:02

never tried it but i imagine this would be some help

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

Foundry

2014-03-25 00:48:38

From: Sk1nyNerd
never tried it but i imagine this would be some help

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


Ok, so I have got it to send a text with a little messing around with that. Thanks rep+

I have a few things I still need help with though. How would I pass a custom string to it? I currently have this:

program awesome;

begin
if getPage('http://127.0.0.1/phpfiles/SenderOfDoom.php') then
writeLn('hooray, sent it.');
end.

and the php file is this:

[PHP]<?php
require_once 'swift/lib/swift_required.php';

$transport = Swift_SmtpTransport::newInstance('smtp.gmail.com', 465, "ssl")
->setUsername('hardcorboter') //don't use @gmail.com
->setPassword('censored');

$mailer = Swift_Mailer::newInstance($transport);

$message = Swift_Message::newInstance('Hey there')
->setFrom(array('hardcorboter@gmail.com' => 'ABC'))
->setTo(array('censored@vtext.com'))
->setBody('Hello, test…);

$result = $mailer->send($message);
?> [/PHP]

Frement

2014-03-25 01:13:25

Modify the URL to be: "http://127.0.0.1/phpfiles/SenderOfDoom.php?customstring=somestringhere"

And in the PHP script, you can access the "customstring" GET variable with $_GET["customstring"].

Foundry

2014-03-27 00:15:06

From: Frement
Modify the URL to be: "http://127.0.0.1/phpfiles/SenderOfDoom.php?customstring=somestringhere"

And in the PHP script, you can access the "customstring" GET variable with $_GET["customstring"].



Thanks. I was able to work on it some more today and with the info you provided I made the function that sends the texts.

Was easier than I thought. Will post again if I need help with reading the email and sending commands.