Help | Mail System
#1

Hello All ,
i have using mail system in my gm , but when i send email to someone i can only in words ...
my command is like this : /Mail [Receiver] [Title] [Message] ...
and i want that its will be like this : /Mail [Receiver] [Title] [Ifarme URL] ...
i want that it will send a iframe in the mail... but i cant do it
can any one can help me to this ?
its my SendMail Stock :
Код HTML:
stock SendMail(reciever[], sender[], subject[], message[])
{
	new buffer[512],string[MAX_MAIL_LENGTH];
	EncodeURL(subject, strlen( subject ) + 1); // Thanks to g_aSlice :))
	EncodeURL(message, strlen( message ) + 1); // Thanks to g_aSlice :))
    format(string, sizeof(string), "qrb.netau.net/Mailer.php?sender=%s&reciever=%s&subject=",sender,reciever);
    memcpy(buffer,subject,.numbytes = (strlen(subject)+1)*4);
    strcat(string,buffer);
    strcat(string,"&message=");
    memcpy(buffer,message,.numbytes = (strlen(message)+1)*4);
    strcat(string,buffer);
    printf("%s", string);
    HTTP(1, HTTP_GET, string, "", "MailResponse");
}
and this is Mailer.php:
Код HTML:
<?
$to      = $_GET['reciever'];
$subject = $_GET['subject'];  
$message = $_GET['message'];
$headers = "From:" . $_GET['sender'];


mail($to, $subject, $message, $headers);

?>
how can i do this ??



The Command :
Код HTML:
	if(strcmp(cmd, "/mail", true) ==0)
	{
		if(AccInfo[playerid][Level] == 20)
		{
	    	new Meqabel[256],Titel[256], Msg[256];
			Meqabel = strtok(cmdtext,idx);
			Titel = strtok(cmdtext,idx);
			Msg = strrest(cmdtext,idx);
			if(!strlen(Meqabel) || !strlen(Titel) || !strlen(Msg))return
			SendClientMessage(playerid, LIGHTBLUE2, "Usage: /Mail [Mail] [Titel] [The Message]") &&
			SendClientMessage(playerid, orange, "Function: Will Send Mail To Specified Mail");
    		SendMail(Meqabel, "Support@ProDeathMatch.com", Titel,Msg);
			SendClientMessage(playerid,green,"ддегтд рщмзд бдцмзд");
			return 1;
		}
	else return SendClientMessage(playerid,red,"! аъд ма бшоъ агойп вбедд осфйч");
	}
Reply
#2

Appending the iframe code in the end would be better to do in PHP, with simplicity...
PHP код:
$message .= 'iframe here'
Also if you're not doing anything with the $to and $subject, why not directly put them as parameters?
PHP код:
$message $_GET['message'];
$headers "From:" $_GET['sender'];
mail($_GET['receiver'], $_GET['subject'], $message$headers); 
(also got to mention that it is actually receiver, not reciever!)

This brings us to the next major problem: GET method only allows the parameters to be 128 characters in length, so your URL will most likely get "cut off" by the webserver. Use a POST call instead, doing like this in that case:
pawn Код:
format(string, sizeof(string), "key=value&key2=value2", ...);
HTTP(1, HTTP_POST, "qrb.netau.net/Mailer.php", string, "MailResponse");
Reply
#3

So how i can send an ifarme ?
can you do this for me ? :P
I Cant do this :P
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)