sending mail via SMTP from localhost to internet (yahoo, gma

Problems with the Windows version of XAMPP, questions, comments, and anything related.

sending mail via SMTP from localhost to internet (yahoo, gma

Postby 2108 » 25. April 2008 14:54

Hi guys,

I'm trying to get a php script to send an e-mail from localhost to users e-mail address supplied (when htey register to my site) but i get the following error:

Warning: mail() [function.mail]: SMTP server response: 550 RCPT TO:<new@new.com> Relaying not allowed - please use SMTP AUTH in C:\xampp\htdocs\signuppost.php on line 36

Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\signuppost.php:36) in C:\xampp\htdocs\signuppost.php on line 38



heres the script for my signuppost.php:


if(isset($_POST['txtemail']))
{
$query="SELECT * FROM tbl_user WHERE u_email='".$_POST['txtemail']."'";
$q=mysql_query($query);
$QRES = mysql_num_rows($q);

if($QRES == "0")
{
$query = "INSERT INTO tbl_user(user_name,user_password,u_email,u_level,user_regdate,`lname`, `address1`, `address2`, `city`, `state`, `zip`, `country`, `phone`) VALUES ('$fname','$password','$email',1,NOW(),'$lname','$add1','$add2','$city','$state','$zip','$country','$phone')";

//echo $query;

$ok=mysql_query($query);
if($ok)
{
$from = "localhost";
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers .= "From: $form <$from>\r\n"."Reply-To: $form<$from>\r\n"."X-Mailer: PHP/" . phpversion()."\r\n";
$msg = "Dear User, Welcome to my site Thank you for choosing my site.";
mail($email,'Successful Registration with my site',$msg,$headers);

header("location: message.php?msg=suOK");
}
else
{
header("location: message.php?msg=suerr");
}
}else{
header("location: message.php?msg=suem");
}
}


in my php.ini i have:

;for win32 only
SMTP = smtp.localhost
smtp_port = 25


sendmail_from = localhost



please advise what i can do to get this to work

any help appreciated

thanks :D
2108
 
Posts: 6
Joined: 25. April 2008 14:38

Postby Nobbie » 25. April 2008 16:10

Which mail server software do you have on your PC? How is it configured?
Nobbie
 
Posts: 13183
Joined: 09. March 2008 13:04

Postby 2108 » 25. April 2008 16:28

I'm using the Mercury mail server which comes with XAMPP, i've started that on the XAMPP control panel and went to status to see that SMTP service is activated.

Anything im missing here? :?
2108
 
Posts: 6
Joined: 25. April 2008 14:38

Postby Nobbie » 25. April 2008 22:12

>Anything im missing here?

Yes, the whole configuration.
Nobbie
 
Posts: 13183
Joined: 09. March 2008 13:04

Postby 2108 » 25. April 2008 23:03

ok, so where can i go from here?
2108
 
Posts: 6
Joined: 25. April 2008 14:38

Postby Nobbie » 25. April 2008 23:21

Read documentation?!
Nobbie
 
Posts: 13183
Joined: 09. March 2008 13:04

Postby 2108 » 25. April 2008 23:35

Nobbie wrote:Read documentation?!


wow, you really must be a genius at this :roll:

anyone else have a SOLUTION?

Thanks!
2108
 
Posts: 6
Joined: 25. April 2008 14:38

Postby Wiedmann » 26. April 2008 00:08

Warning: mail() [function.mail]: SMTP server response: 550 RCPT TO:<new@new.com> Relaying not allowed - please use SMTP AUTH in

Somewhere in Mercury is a setting "Do not permit SMTP relaying of non-local mail", just change this.
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 98 guests