Link to home
Start Free TrialLog in
Avatar of kenabbott
kenabbottFlag for United Kingdom of Great Britain and Northern Ireland

asked on

PHP mail function

Hi

I am running Apache and using PHP.  I want to use the mail function within PHP but I am getting the 'failed to connect to mailserver' etc error message.  What do I need to do to get this working?

Many thanks
Avatar of Roonaan
Roonaan
Flag of Netherlands image

You need to edit php.ini and look for the mail settings. Then restart your apache.

Are you using windows or *x

-r-
Avatar of kenabbott

ASKER

Yes I'm on Windows.  What do I need to change in php.ini?
Look for your smtp_host setting

-r-
Sorry, I've not done this before.  Is this what I'm looking for?

[mail function]
; For Win32 only.
SMTP = localhost

And do I need to change the smtp setting to my ISPs smtp?

Thanks for your help
Yes, that is the right directive. You need indeed set it to your ISP's or hosting providers SMTP.

-r-
Hi

I've set my local php.ini file to the same settings as my hosts php.ini but I am getting

Warning: mail() [function.mail]: SMTP server response: 550 5.7.1 Unable to relay for info@rwsd.co.uk

where the latter is the email address I'm trying to send to

Any ideas?

Many thanks

Ken
ASKER CERTIFIED SOLUTION
Avatar of Roonaan
Roonaan
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial