SA-MP Forums Archive
Email confirmation script. - 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: Email confirmation script. (/showthread.php?tid=665765)



Email confirmation script. - XStormiest - 15.04.2019

I'm trying to make an email confirmation for my script
Here is the php code in my xampp server

The problem is that whatever I"m doing the email is not being sent...
Code:
<?php

	if( isset( $_GET['code'] ) )
	{
		$code = $_GET['code'];
		$email = $_GET['email'];
		$message = $_GET['message'];
		if( isset( $email) && !empty($email) )
		{
			if( isset($message) && !empty($message) )
			{
				$message = str_replace("-", " ", $message);
				mail($email, "Email confirmation", $message, "From \" Project Omega: Tales of Life \" <potol@samp.com>\r\n", "X-Mailer" . phpversion());
			}
		}
	}

?>
And here are the functions and lines that relates to it.
Code:
Public:EmailDelivered(playerid, response, data[])
{
	new buffer[128];
	if(response == 200)
	{
	    SendClientMessage(playerid, COLOR_WHITE, "[ACC] Email has been succesfully delivered!");
	}
	else
	{
	    format(buffer, sizeof(buffer), "Error: %s", data);
	    SendClientMessage(playerid, COLOR_WHITE, "[ACC] Email failed to deliver...");
	}
}
Code:
new text[256];
format(P_Account[playerid][email], 40, "%s", inputtext);
format(text, sizeof text, "78.96.226.61/POTOL/email.php?code=%s&email=%s&message=This-is-a-message-generated-by-the-server.Hello-%s-Your-key-is-%s-.", key, P_Account[playerid][email],GetUserName(playerid), key);
HTTP(playerid, HTTP_GET, text, " ", "EmailDelivered");



Re: Email confirmation script. - XStormiest - 16.04.2019

So..nobody knows how to that?


Re: Email confirmation script. - Marshas - 16.04.2019

Try to access this:
78.96.226.61/POTOL/email.php?code=%s&email=%s&message=This-is-a-message-generated-by-the-server.Hello-%s-Your-key-is-%s
Directly from chrome, pasting it in url. Php error should appear if there any.
Next thing, put your php script into /var/www/html direction of your vps server, then you will be able to access it, because now, I tried to access that file, but I can't.


Re: Email confirmation script. - GeorgeLimit - 20.10.2019

You need webhost to host your mail SMTP.