Weird error when I try to send an email with HTTP function - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Weird error when I try to send an email with HTTP function (
/showthread.php?tid=665936)
Weird error when I try to send an email with HTTP function -
XStormiest - 21.04.2019
So I tried to send an email with a php code for an account confirmation, all good untill I type my email then I get this
Edit: Error 400 Bad Request
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>Bad request!</title>
<link rev="made" href="mailto:postmaster@localhost" />
<style type="text/css"><!--/*--><![CDATA[/*><!--*/
body { color: #000000; background-color: #FFFFFF; }
a:link { color: #0000CC; }
p, address {margin-left: 3em;}
span {font-size: smaller;}
/*]]>*/--></style>
</head>
<body>
<h1>Bad request!</h1>
<p>
Your browser (or proxy) sent a request that
this server could not understand.
</p>
<p>
If you think this is a server error, please contact
the <a href="mailto:postmaster@localhost">webmaster</a>.
</p>
<h2>Error 400</h2>
<address>
<a href="/">localhost</a><br />
<span>Apache/2.4.33 (Win32) OpenSSL/1.0.2o PHP/5.6.36</span>
</address>
</body>
</html>
What I used to form the link to send
Code:
format(message, sizeof(message), "Hello %s, this is an email for account confirmation\n.Your Key code is %s", GetUserName(playerid), key);
for(new i = 0; i < strlen(message); i++)
if( message[i] == ' ' )
message[i] = '-';
format(link, sizeof(link), "78.96.226.61/POTOL/vendor/email.php?code=%s&email=%s&message=%s", key, P_Account[playerid][email], message);
printf("%s", link);
HTTP(playerid, HTTP_GET, link, " ", "OnConfirmationPending");
ShowEmailCDialog(playerid);