Sticmy Posted September 23, 2017 Share Posted September 23, 2017 (edited) because I get this I do not understand help me please code script 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) -- This website is not available any more so add the PHP files in your own website and put URL here. 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 code php <?php include( "mta_sdk.php" ); $input = mta::getInput(); $subject = $input[0]; $email = $input[2]; $message = $input[3]; $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; $headers .= $input[1] . "\r\n"; $mailSent = mail($email, $subject, $message, $headers); if ($mailSent) { mta::doReturn("Email sent to ".$email); echo "\r\nMail sent to $email with text: $message!"; } else { mta::doReturn("Failed to send email to ".$email." - Unknown error, restart script and check webpage!", 2); } ?> Edited September 23, 2017 by Steven'Bc Link to comment
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