Keep getting an error message when I go to test my code.
Moderator: General Moderators
Keep getting an error message when I go to test my code.
I am running Windows 2000, I use IIS web server, and I have recently installed PHP on my computer. I went in and installed PHP in ISAPI mode.
Getting onto the problem when I do a simple test.php page and look at it online I get the following error message:
Warning: mail() [function.mail]: SMTP server response: 501 5.5.4 Invalid Address in d:\Inetpub\wwwroot\Media\testemail.php on line 2
Email test
test.php has the following code:
<?php
mail("bjackson@ids-tn.com", "Test message", "This is just a test", "From: my Server");
echo "Email test";
?>
CAN ANYBODY PLEASE HELP ME.
Getting onto the problem when I do a simple test.php page and look at it online I get the following error message:
Warning: mail() [function.mail]: SMTP server response: 501 5.5.4 Invalid Address in d:\Inetpub\wwwroot\Media\testemail.php on line 2
Email test
test.php has the following code:
<?php
mail("bjackson@ids-tn.com", "Test message", "This is just a test", "From: my Server");
echo "Email test";
?>
CAN ANYBODY PLEASE HELP ME.
I have changed the code to the following:
<?php
mail("Test message", "This is just a test", "From: bjackson@ids-tn.com");
echo "Email test";
?>
And now I have this message:
Warning: mail() [function.mail]: "sendmail_from" not set in php.ini or custom "From:" header missing in d:\Inetpub\wwwroot\Media\testemail.php on line 2
Email test
Maybe this means we are getting closer. By the way sendmail_from on the php.ini states
sendmail_from = djones@ids-tn.com
<?php
mail("Test message", "This is just a test", "From: bjackson@ids-tn.com");
echo "Email test";
?>
And now I have this message:
Warning: mail() [function.mail]: "sendmail_from" not set in php.ini or custom "From:" header missing in d:\Inetpub\wwwroot\Media\testemail.php on line 2
Email test
Maybe this means we are getting closer. By the way sendmail_from on the php.ini states
sendmail_from = djones@ids-tn.com
Well I researched the "to" argument and come up with this code now.
<?php
mail('bjackson@ids-tn.com',"Test message","This is just a test","From: baj2c@mtsu.edu");
echo "Email test";
?>
Now I have this error message:
Warning: mail() [function.mail]: SMTP server response: 550 5.7.1 Unable to relay for bjackson@ids-tn.com in d:\Inetpub\wwwroot\Media\testemail.php on line 2
Email test
<?php
mail('bjackson@ids-tn.com',"Test message","This is just a test","From: baj2c@mtsu.edu");
echo "Email test";
?>
Now I have this error message:
Warning: mail() [function.mail]: SMTP server response: 550 5.7.1 Unable to relay for bjackson@ids-tn.com in d:\Inetpub\wwwroot\Media\testemail.php on line 2
Email test
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
bool mail ( string to, string subject, string message [, string additional_headers [, string additional_parameters]] )
the first argument is the to, as in the email address to send the email to. Just the address, no "Jim Jones <jjones@aolcoma.com", strictly the address.
The second argument is the subject of the email.
The third is the message (actual content) of the email.
The fourth is the headers argument. Things like the pretty "to" with the person's name, "from" address, among other header type things.
the first argument is the to, as in the email address to send the email to. Just the address, no "Jim Jones <jjones@aolcoma.com", strictly the address.
The second argument is the subject of the email.
The third is the message (actual content) of the email.
The fourth is the headers argument. Things like the pretty "to" with the person's name, "from" address, among other header type things.
i have done some more research and I think the problem is that bjackson@ids-tn.com is on an exchange server which requires authentication.
The Outlook that is on my web server is through my exchange server.
So all this means that I cannot get access because there is no where I can put in my password. So, it looks like I will have to get a seperate SMTP server on my Web server.
Does any of this sound right to you?
Thanks for all of your help.
The Outlook that is on my web server is through my exchange server.
So all this means that I cannot get access because there is no where I can put in my password. So, it looks like I will have to get a seperate SMTP server on my Web server.
Does any of this sound right to you?
Thanks for all of your help.
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
you may want to look at phpmailer: http://phpmailer.sf.net It has some authentication connection stuff..