PDA

View Full Version : Mail problem


DiGiTaL_AnGeL
09/03/2013, 07:59 AM
Hi. Tried Slice's include, Mailer (http://forum.sa-mp.com/showthread.php?t=197755) but it doesn't sends any mail. Here is what it prints:
[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:
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;
}

Vince
09/03/2013, 09:36 AM
Do you actually have PHP enabled on your webserver? I don't think it's supposed to output raw PHP code.

DiGiTaL_AnGeL
09/03/2013, 09:43 AM
Webserver? I tested it from my pc, and I used the site for mailer.php given by Slice.

Vince
09/03/2013, 09:49 AM
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.