I'll share some of the script maybe some of you have more ideeas.
session_start();
$senderid="34085046059013"; //sender id usually a GM character that is the dbid from t_user
$sendername="Bogdan"; //GM Name from which the mail will be sent
$title="Web Shop"; // title
$content="Large Emerald Thank you for buying"; //content
$haveacc="1"; // if mail have item attached
$accessory="\0\n \0�� \0`@T\r\0\0\0\0\0\0\0"; // here is all the secret and the biggest problem! all is write there is just symbols because the column from the table are BLOB files that mean they are kind of encrypted and theres no possible way unless we have the source code of the game_server to can decrypt this thing! that symbols well idk what exactly they are but the problem is after restarting the server this DATA won't work anymore and no gem will be sent just a blank mail! this is what i need to improve.
$log="\0\n \0�� \0`@T\r\0\0\0\0\0\0\0"; // same thing as the other but this will remain unchanged even after you read the mail
$starttime=time(); // real time on the machine
$limittime=$starttime+2592000; // real time + 30 days
$para2="-373142290"; // i really don't know this thing just a parameter i think but it can be any number i guess
the rest of the script is easy cuz well you know just insert those fields into database the only problem is that thing with restarting the server or after some time the script won't work anyway but i'm pretty sure if you try those right now it won't work for your server.
How i tricked those blob you may ask? Well.. it wasn't that difficult i've sended a mail in game normally with a large emerald and in phpmyadmin I view the BLOB as text and see those symbols or you can with navicat too !
EDIT: If you try tracking the mails sended with just large emeralds well when you send more with some time between sents you will notice a change between the hex/symbols on the column