I need some help !! Please

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
newbi
Forum Newbie
Posts: 11
Joined: Thu Jan 08, 2004 12:58 am
Contact:

I need some help !! Please

Post 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.");
}
?>
User avatar
Pyrite
Forum Regular
Posts: 769
Joined: Tue Sep 23, 2003 11:07 pm
Location: The Republic of Texas
Contact:

Post by Pyrite »

What OS? What MTA? What Webserver?
User avatar
Pyrite
Forum Regular
Posts: 769
Joined: Tue Sep 23, 2003 11:07 pm
Location: The Republic of Texas
Contact:

Post 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?
User avatar
newbi
Forum Newbie
Posts: 11
Joined: Thu Jan 08, 2004 12:58 am
Contact:

Post 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).
User avatar
newbi
Forum Newbie
Posts: 11
Joined: Thu Jan 08, 2004 12:58 am
Contact:

Post by newbi »

i'm not using my mail server. so can i just link to my email ? such as hotmail or yahoo ?
User avatar
Pyrite
Forum Regular
Posts: 769
Joined: Tue Sep 23, 2003 11:07 pm
Location: The Republic of Texas
Contact:

Post 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
User avatar
newbi
Forum Newbie
Posts: 11
Joined: Thu Jan 08, 2004 12:58 am
Contact:

Post 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 ?
User avatar
Pyrite
Forum Regular
Posts: 769
Joined: Tue Sep 23, 2003 11:07 pm
Location: The Republic of Texas
Contact:

Post 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.
Post Reply