FlyingSpoon Posted May 16, 2015 Posted May 16, 2015 Error: E-Mail not sent due to webpage errors, check the script and/or page provided. Resource: https://community.multitheftauto.com/index.php?p= ... s&id=11231 local randomMails = {"[email protected]", "[email protected]", "[email protected]", "[email protected]", "[email protected]"} function fromRandom() return randomMails[math.random(#randomMails)] end function sendCustomMail(subject, header, sendto, mail) local header = "From: "..subject.." <"..(header or fromRandom())..">" callRemote("http://mta.skcit.tk/emailer.php", returns, subject, header, sendto, mail) end addEvent("sendEMail", true) addEventHandler("sendEMail", root, sendCustomMail) function returns(msg, num) if msg == "ERROR" or (not msg) then outputDebugString("E-Mail not sent due to webpage errors, check the script and/or page provided.", 2) else outputDebugString(msg, num or 3) end end Server Side - I tried that website, but it don't exist anymore, and I really need this resource? Anyway I can fix it? http://mta.skcit.tk/emailer.php
FlyingSpoon Posted May 16, 2015 Author Posted May 16, 2015 Which PHP File? I have, mailer.php and mta_sdk.php
FlyingSpoon Posted May 16, 2015 Author Posted May 16, 2015 Okay I setup mailer.php and mta_sdk.php it says mail sent but I check my email nothing is there.
Walid Posted May 16, 2015 Posted May 16, 2015 Okay I setup mailer.php and mta_sdk.php it says mail sent but I check my email nothing is there. try this untested -- Sever side function returnMail(result, player) if result == true then outputChatBox("You mail has been successfully sended !", player, 255, 255, 255, true) else outputChatBox("Sorry, there is a problem in your website", player, 255, 255, 255, true) end end addEvent("sendEMail", true) addEventHandler("sendEMail", getRootElement(), function(player, target, subject, msg) callRemote ( --[[ you website here ]], returnMail, player, target, subject, msg ) end) -- Php <?php include( "mta_sdk.php" ); $input = mta::getInput(); $player = $input[0]; $target = $input[1]; $subject = $input[2]; $message = $input[3]; $mail = $target; if (!preg_match("#^[a-z0-9._-]+@(hotmail|live|msn).[a-z]{2,4}$#", $mail)) { $passage_ligne = "\r\n"; } else { $passage_ligne = "\n"; } $message_txt = " "; $message_html = "Test".$message.""; $boundary = "-----=".md5(rand()); $sujet = "MTA - ".$subject.""; $header = "From: \"MTA\"<[email protected]>".$passage_ligne; $header.= "Reply-to: \"MTA\" <[email protected]>".$passage_ligne; $header.= "MIME-Version: 1.0".$passage_ligne; $header.= "Content-Type: multipart/alternative;".$passage_ligne." boundary=\"$boundary\"".$passage_ligne; $message = $passage_ligne."--".$boundary.$passage_ligne; $message.= $passage_ligne."--".$boundary.$passage_ligne; $message.= "Content-Type: text/html; charset=\"ISO-8859-1\"".$passage_ligne; $message.= "Content-Transfer-Encoding: 8bit".$passage_ligne; $message.= $passage_ligne.$message_html.$passage_ligne; $message.= $passage_ligne."--".$boundary."--".$passage_ligne; $message.= $passage_ligne."--".$boundary."--".$passage_ligne; mail($mail,$sujet,$message,$header); $theresult = true; mta::doReturn($theresult, $player); ?>
WhoAmI Posted May 16, 2015 Posted May 16, 2015 If you are using apache on VPS you have to configure mail server on it. I had the same problem. If you have mail configured, check spam. I've used the same resource and you don't have to change anything in it. If it doesn't work, it's caused by WWW server.
FlyingSpoon Posted May 16, 2015 Author Posted May 16, 2015 Bad argument @ 'ouputChatBox' [Expected element at argument 2, got string 'Enter a subject'] I am using my localhost, and if possible how? I am using XAMPP... Is it better if I upload it online?
WhoAmI Posted May 16, 2015 Posted May 16, 2015 Don't use Walid's code. You don't have to change anything in this resource. Yea, upload it online to some WWW server from hosting.
FlyingSpoon Posted May 16, 2015 Author Posted May 16, 2015 I uploaded it, It says in-game - Email Sent, But I don't receive anything in my email again.
FlyingSpoon Posted May 16, 2015 Author Posted May 16, 2015 Yay got it! Thank you WhoAmI, I had a error, just removed that line and done! Tadaaa! Thanks for helping and supporting me +1 WhoAmI
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now