Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ini and emailing - a basic question 1

Status
Not open for further replies.

kupe

Technical User
Sep 23, 2002
376
Sorry about the very basic question, but how do I configure php.ini for emailing, please, Experts?
 
Sorry, JP, windows2k and xp.
 
make sure that your ini file has the following (filled in for your installation:
Code:
[mail function]
; For Win32 only.
SMTP = x.x.x.x
smtp_port = 25

; For Win32 only.
sendmail_from = youremail@domain.com

 
Thanks very much, JPadie. The difference between yours and what is there is this:

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

Should I make the email address my email address, please?

I'm at the learning stage, using xampp with apache as the server. Cheers
 
no - all that is fine. it is better to use a proper address as the sendmail_from as some email servers may validate incoming mail using this information.

so the next thing is to check whether it works!

a simple check is
Code:
error_reporting(E_ALL);
$to = "" ;//enter your email address for testing

$rslt = mail ($to, "Test message", "This is a test message");
if ($rslt) {echo "mail sent successfully";} else {echo "Mail not sent";}

then check your email!

if it does not work then check your firewall settings on your PC and any routers/hardward firewalls to make sure that nothing is stopping you using the outbound port 25 (would be unusual)
 
Much obliged for that. Thanks. This is what I get so far ...

Warning: mail() [function.mail]: SMTP server response: 550 5.7.1 Unable to relay for "my email address" in C:\apachefriends\xampp\htdocs\xampp\EmailTester.php on line 13
Mail not sent

I wonder if this error message rings any bells?
 
I think the error message is just what it says. The mail server you're using is configured to not relay email for the "from" address and IP address you're using.

Want the best answers? Ask the best questions!

TANSTAAFL!!
 
Very droll, sleipnir214. Obviously, I didn't want to reproduce my email address there.

If you're right and the mail server is configured that way, how would I change it, please?

That's the best question. What's the best answer?
 
that depends on the smtp server that you use. which one is it?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top