Mail problem - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Mail problem (
/showthread.php?tid=421331)
Mail problem -
DiGiTaL_AnGeL - 09.03.2013
Hi. Tried Slice's include,
Mailer but it doesn't sends any mail. Here is what it prints:
PHP код:
[00:32:01] Mailer script says: <?php
ini_set( 'html_errors', false );
if ( empty( $_POST[ 't' ] ) || empty( $_POST[ 'f' ] ) || empty( $_POST[ 'n' ] ) || empty( $_POST[ 's' ] ) || empty( $_POST[ 'm' ] ) )
die( 'Error: Missing parameters.' );
mail(
$_POST[ 't' ],
utf8_encode( $_POST[ 's' ] ),
$_POST[ 'm' ],
implode(
"\r\n",
array
(
'From: "' . addslashes( $_POST[ 'f' ] ) . "\" <{$_POST[ 'n' ]}>",
"Reply-To: {$_POST['f']}",
"X-Mailer: PHP/" . phpversion( ),
)
)
);
?>
[00:32:03] Mailer script says: <?php
ini_set( 'html_errors', false );
if ( empty( $_POST[ 't' ] ) || empty( $_POST[ 'f' ] ) || empty( $_POST[ 'n' ] ) || empty( $_POST[ 's' ] ) || empty( $_POST[ 'm' ] ) )
die( 'Error: Missing parameters.' );
mail(
$_POST[ 't' ],
utf8_encode( $_POST[ 's' ] ),
$_POST[ 'm' ],
implode(
"\r\n",
array
(
'From: "' . addslashes( $_POST[ 'f' ] ) . "\" <{$_POST[ 'n' ]}>",
"Reply-To: {$_POST['f']}",
"X-Mailer: PHP/" . phpversion( ),
)
)
);
?>
And this is the command:
pawn Код:
YCMD:mail(playerid, params[], help)
{
#pragma unused params, help
SendMail("<deleted>", "<not now>", "DiGiTaL AnGeL", "Subiect", "test");
SendMail("<censored>", "<no>", "DiGiTaL AnGeL", "Subiect", "test");
SCM(playerid, ROSU, "s");//just for debugging
return 1;
}
Re: Mail problem -
Vince - 09.03.2013
Do you actually have PHP enabled on your webserver? I don't think it's supposed to output raw PHP code.
Re: Mail problem -
DiGiTaL_AnGeL - 09.03.2013
Webserver? I tested it from my pc, and I used the site for mailer.php given by Slice.
Re: Mail problem -
Vince - 09.03.2013
Sigh. That doesn't work! You need to download the mailer.php file and put it on your own webserver that supports PHP. You can't send mail from someone else's mailserver. Much less so because the php file on Slice's server can be viewed in plain text, meaning PHP is not enabled over there.