mail() problem on local server

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
jayshields
DevNet Resident
Posts: 1912
Joined: Mon Aug 22, 2005 12:11 pm
Location: Leeds/Manchester, England

mail() problem on local server

Post by jayshields »

Hi.

Ok, I have a little problem with mail(), and I have read every note on php.net to no avail.

This is the error I get:

Code: Select all

Warning: mail() [function.mail]: SMTP server response: 550 you are not allowed to send mail to <email@jay-designs.co.uk> in C:\Program Files\Apache Group\Apache2\htdocs\collegesite\contact.php on line 37
This is my mail() code:

Code: Select all

$body = "This is a message from $name1 using the Contact Form @ Jay's Photoshop Tutorials.\n";
		$body .= "\n";
		$body .= "----------\n";
		$body .= "\n";
		$body .= $message1;
		//Send the email
		mail ('email@jay-designs.co.uk', 'Message from PS Tutorials Contact Form', $body, 'From: ' . $email1 . "\n");
I've never had problems on paid for servers with this same syntax.

I'm guessing it must be a problem with my php.ini. Here are my current settings:

Code: Select all

SMTP = smtp.ntlworld.com
smtp_port = 25
I'm presuming the default smtp_port of 25 will be OK, and that I should be using my ISP's SMTP server instead of using my IP or localhost.

Does anyone know what's going wrong?

Thanks.
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

Do you have the sendmail_from address also set in the php.ini?

Although, I've got the same ISP as you and although I'm not getting any errors when I try and send e-mails via PHP I'm not receiving them back :?

Mac
User avatar
jayshields
DevNet Resident
Posts: 1912
Joined: Mon Aug 22, 2005 12:11 pm
Location: Leeds/Manchester, England

Post by jayshields »

sendmail_from is commented out. Should I uncomment it and change it to my email address or something?

What settings have you used in yours?
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

I just uncommented it and set it to webmaster@mydomain.com - my guess would be that without it the mailserver rejects the e-mail.

Mac
Post Reply