Jump to content

XMailer Error


ChompGator

Recommended Posts

Hey,

 

The script I have > Users Register, and Are emailed an Activation Link > When Registering > Upon Submission of the form the

Error I/users get is:

Warning: mail() [function.mail]: SMTP server response: 503 5.5.2 Need Rcpt command. in d:\hosting\member\aiim\join\register.php on line 202

 

This is what line 202 reads:

"X-Mailer: PHP/".phpversion());

 

Here is the whole script:

 

<?php

if( isset($_POST['submit']) ) {
$error = array();
$first = mysql_real_escape_string(trim($_POST['first']));
$last = mysql_real_escape_string(trim($_POST['last']));
$email1 = trim($_POST['email']);
$email2 = trim($_POST['emailconfirm']);
$pass1 = trim($_POST['password']);
$pass2 = trim($_POST['passwordconfirm']);
$vatsimid = trim($_POST['vatsimid']);
$country = mysql_real_escape_string(trim($_POST['country']));
$region = mysql_real_escape_string(trim($_POST['region0']));

if( empty($first) ) 
	$error[] = "Need a first name";

if( empty($last) )
	$error[] = "Need a last name";

if( $email1 != $email2 ) 
	$error[] = "Emails do not match";

if( !preg_match('/^[a-zA-Z0-9_\.\-]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-\.]+$/', $email1) )
	$error[] = "Invalid Email";

if( empty($pass1) ) 
	$error[] = "Need a password";

if( $pass1 != $pass2 ) 
	$error[] = "Passwords do not match";

if( !preg_match('/^[\d]{6}$/', $vatsimid) ) 
	$error[] = "Invalid VATSIM ID";

if( $country == "Select a country from list..." )
	$error[] = "Please select a country";

if( $region == "Select a region..." )
	$error[] = "Please select a region";

if( count($error) == 0 ) {
	$res = mysql_query("SELECT 1 FROM aiimreg WHERE email='".mysql_real_escape_string($email1)."'");
	print mysql_error();
	if( $res ) {
		if( mysql_num_rows($res) == 0 ) {
			$key = generateKey();
			$res = @mysql_query("INSERT INTO aiimreg (`email`, `pass`, `key`, `country`, `region`, `vatsimid`, `first`, `last`) ".
								"VALUES ('".mysql_real_escape_string($email1)."', '".mysql_real_escape_string($pass1)."', '".mysql_real_escape_string($key)."', ".
								"'$country', '$region', '$vatsimid', '$first', '$last')");

			if( $res ) {
				$uid = mysql_insert_id();
				mail($email, "Account Activation",
					"Thank you for registering with Western Canada.\n\n".
					"After you activate your account, you can login in with the following...\n".
					"    User ID: $uid\n".
					"    Password: $pass1\n".
					"To activate your account please visit the following URL...\n".
					"    http://www.calgary/join/activate.php?uid=$uid&key=".urlencode($key)." \n\n",
					"From: [email protected]\r\n".
					"Reply-To: [email protected]\r\n".
					"X-Mailer: PHP/".phpversion());
				print "Thank you for registering! Please check your email for activation instructions.";
			} else {
				print mysql_error();
			}
		} else {
			print "There is a user already registered with that email.";
		}
	} else {
		print mysql_error();
	}
} else {
	foreach($error as $err)
		print "<b>$err</b><br />";
}
} else {
?>

Link to comment
https://forums.phpfreaks.com/topic/102443-xmailer-error/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.