Desperate: PHP email form and PHP.ini file?

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
Losty
Forum Newbie
Posts: 1
Joined: Tue May 19, 2009 12:23 pm

Desperate: PHP email form and PHP.ini file?

Post by Losty »

I've been posting on numerous forums, looking for some detailed help...know that any tips or information would be greatly appreciated.

I created a basic feedback form with PHP. When I tested it, I got this message:
Warning: mail() [function.mail]: SMTP server response: 553 sorry, that domain isn't allowed to be relayed thru this MTA (#5.7.1) in [file] on line 116
I looked into this and it seems that I need to config the mail settings in the php.ini file.

The problem: After calling the php info, I'm pretty sure it's my webhost that has access to this file. I contacted them, and they replied by telling me to create a custom one, as they are a "Microsoft Windows 2003 Server that specialize in ASP, ASP.NET, and SQL Server and have limited experience with PHP."

Two scenarios:

1. I manage to convince my host to stop being jerks and edit the file. In that case, what would I need to edit in the php.ini file? The following is all I could find in the phpinfo.php page that relates to mail...would it be one of them:

sendmail_from name@domain.com webmaster
sendmail_path no value no value

2. I create my own php.ini file. If this is the case, could I potentially do the following?

Use this template: http://cvs.php.net/viewvc.cgi/php-src/p ... st?view=co

And then add:

[mail function]
; For Win32 only.
SMTP = mail.host.com ; for Win32 only
smtp_port = 25
sendmail_from= name@host.com ; for Win32 only

; For Win32 only.
;sendmail_from = name@host.com
; For Unix only. You may supply arguments as well (default: "sendmail -t -i").
;sendmail_path =

; Force the addition of the specified parameters to be passed as extra parameters
; to the sendmail binary. These parameters will always replace the value of
; the 5th parameter to mail(), even in safe mode.
;mail.force_extra_parameters =

And if I CAN do that, where would I upload the file? And would I run into issues with the php.ini file the site is already pointing to?


I know it's a little all over the place, but as mentioned before, ANY help would be greatly appreciated.

Thanks!
User avatar
califdon
Jack of Zircons
Posts: 4484
Joined: Thu Nov 09, 2006 8:30 pm
Location: California, USA

Re: Desperate: PHP email form and PHP.ini file?

Post by califdon »

Disclaimer: I am not an expert in SMTP configuration, especially on a Windows server.

Tip: When you're not sure what an error message means, the first thing to do is to search Google with the system or language and the error number, in this case, smtp 553. In seconds you will find many references to that error message.

It doesn't appear to me that your problem will be fixed by anything in the PHP configuration file. It's obviously already finding the server, or it couldn't have issued that error message. It's more likely that the SMTP relay is not set up for relaying, either to some particular domain that you specified in a message header, or perhaps to any external domains. The question you should be asking your hosting service is, "Can I send outside mail through your SMTP server?"

In general, if your hosting service can't support PHP, perhaps you shouldn't be trying to use it with that provider. Either learn ASP or .NET, or consider switching your hosting to a provider who uses Linux and fully supports PHP.
Post Reply