C_Mail -
Cameltoe - 07.11.2010
- C_Mail
~ After a lot of requests i decided to make an simple but effective Mail script.
~ No plugins needed.
~ Only tested on Debian 5.
~ Simple and smooth. Does exactly what it should .. Nothing more Nothing less.
Link(s):
~ Pastebin - Include.v.1.2
~ Pastebin - Php file.v.1.1
How to:
~ Upload the php script to your host.
~ Edit the include file to match your host.
~ Put the include file inside '/pawno/include'.
~ Add the include to your gm by : '#include <c_mail>'.
~ Enjoy.
Editing the include:
Look into the include and look for the 'SendMail' Stock, and the format part, you will see theres 'localhost/index.php' this would be the path to were you uploaded your script Ex: sa-mp.com/index.php. Edit it to match your host.
Code:
pawn Код:
stock SendMail(reciever[], sender[], subject[], message[])
{
new string[128];
format(string, sizeof(string), "localhost/index.php?sender=%s&reciever=%s&subject=%s&message=%s",sender,reciever,subject,message);
HTTP(1, HTTP_GET, string, "", "MailResponse");
}
That's it.
Creditz:
~ g_aSlice.
~ SA-MP dev team.
~ Me .
Can't get it working? write an reply and let me know about your problem.
Re: C_Mail -
Luis- - 07.11.2010
Wow, Looks good
Re: C_Mail -
Cameltoe - 07.11.2010
Quote:
Originally Posted by -Luis
Wow, Looks good
|
Thanks, simple and smooth. Does exactly what it should .. Nothing more Nothing less.
Re: C_Mail -
willsuckformoney - 07.11.2010
Nice, I seen something like this last month too. Also been seeing a lot of requests too.
Re: C_Mail -
Cameltoe - 07.11.2010
Quote:
Originally Posted by willsuckformoney
Nice, I seen something like this last month too. Also been seeing a lot of requests too.
|
Could you link me please? I searched around couldn't find anything but request's.
Re: C_Mail -
asdfgh98 - 07.11.2010
Nice Include.
Re: C_Mail -
woot - 07.11.2010
You really should remove that hosted php file by you, it's extremely easy abusable to send spam e-mails and your IP will be blacklisted.
Other than that, there's already an include doing the same thing. Can't find it right now either ..
Re: C_Mail -
Cameltoe - 07.11.2010
Quote:
Originally Posted by exora
You really should remove that hosted php file by you, it's extremely easy abusable to send spam e-mails and your IP will be blacklisted.
Other than that, there's already an include doing the same thing. Can't find it right now either ..
|
Not hosted by me at all
I'll also in an future version make the PHP script safer.
Re: C_Mail -
BLAbla93 - 08.11.2010
Wow this is a really interesting way to use that HTTP function nice job.
Re: C_Mail -
Haji - 08.11.2010
looks good.
Re: C_Mail -
Aleluja - 08.11.2010
Look good.
Re: C_Mail -
Cameltoe - 08.11.2010
Quote:
Originally Posted by BLAbla93
Wow this is a really interesting way to use that HTTP function nice job.
|
Quote:
Originally Posted by Haji
looks good.
|
Quote:
Originally Posted by Aleluja
Look good.
|
Thanks all !! i will sooner or later update to prevent abusing.
Re: C_Mail -
Brian_Furious - 08.11.2010
Awesome, nice work...i'll use it
Re: C_Mail -
Scenario - 08.11.2010
This is pretty neat man, good work!
Re: C_Mail -
Cameltoe - 08.11.2010
Quote:
Originally Posted by Brian_Furious
Awesome, nice work...i'll use it
|
Quote:
Originally Posted by RealCop228
This is pretty neat man, good work!
|
Thanks, both of you !! Any suggestions?
Re: C_Mail -
WillyP - 08.11.2010
Didn't you make this because someone was put a topic about it? :S
Nice though.
Re: C_Mail -
Cameltoe - 08.11.2010
Quote:
Originally Posted by [FU]Victious
Didn't you make this because someone was put a topic about it? :S
Nice though.
|
Yeah, iv'e seen a lot of requests for a mail script.. sa-mp forums is flooded by threads requesting a mail script.. so i decided to make one
This simple but yet effective script could also teach you how to use the http function.
Re: C_Mail -
WillyP - 08.11.2010
Quote:
Originally Posted by Cameltoe
Yeah, iv'e seen a lot of requests for a mail script.. sa-mp forums is flooded by threads requesting a mail script.. so i decided to make one
This simple but yet effective script could also teach you how to use the http function.
|
Very good though, I will be using.
Re: C_Mail -
Cameltoe - 08.11.2010
Quote:
Originally Posted by [FU]Victious
Very good though, I will be using.
|
Great
tell me what you think, and maybe add some suggestions?
Re: C_Mail -
Slice - 08.11.2010
yo,
Good job on this. You should, hoever, encode the incoming data to avoid any issues (for example, using the ampersand (&) could cause havoc.).
I made this function for you:
pawn Код:
stock EncodeURL( szString[ ], iSize = sizeof( szString ) )
{
for ( new i = 0, l = strlen( szString ); i < l; i++ )
{
switch ( szString[ i ] )
{
case '!', '(', ')', '\'', '*',
'0' .. '9',
'A' .. 'Z',
'a' .. 'z':
{
continue;
}
case ' ':
{
szString[ i ] = '+';
continue;
}
}
new
s_szHex[ 8 ]
;
if ( i + 3 >= iSize )
{
szString[ i ] = EOS;
break;
}
if ( l + 3 >= iSize )
szString[ iSize - 3 ] = EOS;
format( s_szHex, sizeof( s_szHex ), "%02h", szString[ i ] );
szString[ i ] = '%';
strins( szString, s_szHex, i + 1, iSize );
l += 2;
i += 2;
if ( l > iSize - 1 )
l = iSize - 1;
}
}
Simply run any incoming strings through that. Make sure you have enough space in the array, though.