Page 1 of 1

I need some help !! Please

Posted: Sun Jan 11, 2004 9:41 am
by newbi
Warning: mail(): SMTP server response: 550 5.7.1 Unable to relay for newbi@hotmail.com in C:\fyp\gs\mail_hr.php on line 30
Error sending Job Application




what the error about ?? and how to debug ??
--some of part from coding---
....

$to = "newbi@yahoo.com";
$subj = "Online Application";
$header = "\nForm: newbi@hotmail.com\n";
$body = "\nName: " . quotemeta ($applicant) .
"\nPhone: " . quotemeta ($phone) .
"\nAddress:\n" . quotemeta ($addr) .
"\nE-mail: " . addslashes ($email) .
"\nCountry: $country" .
"\nPosition: $position" .
"\nAvailable immediately: $avail\n";
$success = mail($to, $subj, $body, $header);

$textfile = fopen($dir . "/details.txt","w");
fwrite($textfile, $body);
fclose($textfile);



if($success)
{
echo ("Your application has been sent successfully.</B><BR><BR>" .
"We will be in touch shortly; in the meantime, thank you " .
"for your interest in Phop's Bicycles.");
}
else
{
echo ("Error sending Job Application.");
}
?>

Posted: Sun Jan 11, 2004 9:47 am
by Pyrite
What OS? What MTA? What Webserver?

Posted: Sun Jan 11, 2004 9:49 am
by Pyrite
Basically means your mail server can't relay from the address you have set in your php.ini assuming you're using the php mail() function. So r u running your own mail server?

Posted: Sun Jan 11, 2004 10:38 am
by newbi
i'm a beginner of php, and i cant solve this problem. u r mention on setting in php.ini , so wat should i set ? and i using the apache server.
win xp (os).

Posted: Sun Jan 11, 2004 10:38 am
by newbi
i'm not using my mail server. so can i just link to my email ? such as hotmail or yahoo ?

Posted: Sun Jan 11, 2004 10:52 am
by Pyrite
No

What do you have "smtp = " set to in your php.ini ?

An easy fix since you using XP is to just install IIS (comes with Windows) and the SMTP server part of it. Then under the properties of it, just add your ip to the list of allowed relays and set your "smtp = yourip" in your php.ini

Posted: Sun Jan 11, 2004 10:55 am
by newbi
SMTP = localhost ; for Win32 only
sendmail_from= me@localhost.com ; for Win32 only


so what should i change for the :-
SMTP = [my ipaddress] ?
sendmail_from= [me@localhost.com]

how if i want sent to my email ? is it ok ?

Posted: Sun Jan 11, 2004 3:34 pm
by Pyrite
Ok, then install IIS and SMTP, and open up the IIS Manager and right click the SMTP server and properties, and under Relays, add 127.0.0.1 (which is localhost) to the allowed relays.

Or you could try your ISP's smtp server, but that is 50/50 depending on whether they allow relaying or require authentication.