Solved

PHP mail function

Posted on 2007-04-03
7
139 Views
Last Modified: 2008-02-01
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
0
Comment
Question by:kenabbott
  • 4
  • 3
7 Comments
 
LVL 49

Expert Comment

by:Roonaan
ID: 18841986
You need to edit php.ini and look for the mail settings. Then restart your apache.

Are you using windows or *x

-r-
0
 

Author Comment

by:kenabbott
ID: 18842150
Yes I'm on Windows.  What do I need to change in php.ini?
0
 
LVL 49

Expert Comment

by:Roonaan
ID: 18842161
Look for your smtp_host setting

-r-
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:kenabbott
ID: 18842188
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
0
 
LVL 49

Expert Comment

by:Roonaan
ID: 18842193
Yes, that is the right directive. You need indeed set it to your ISP's or hosting providers SMTP.

-r-
0
 

Author Comment

by:kenabbott
ID: 18842284
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
0
 
LVL 49

Accepted Solution

by:
Roonaan earned 500 total points
ID: 18842295
SMTP servers commonly only allow pc's/applications running in their own network to use their services. As your local webserver is not running from the hostings's serverpark the SMTP will deny access/deny relay.
For your local system you might therefor need to lookup your access providers SMTP from your email client, and use that one.

Kind regards

-r-
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

680 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question