email problem in php – PHP

  php

Q(Question):

I want to ask about email by the coding of php. Now, I using internal serval if i want send email out by internal serval can or not? Is it i want send email out must open one web? did any way can link out?

A(Answer):

I assume that by ‘internal server’ you mean you have a server installed at your PC, somthing like WAMP or alike.

In order to use the mail functions of PHP you must adapt the appropriate settings in your PHP.INI file. See PHP Mail functions on how to accomplish that.

Ronald

A(Answer):

i using apache and mysql. u mean is it this two?

A(Answer):

i using apache and mysql. u mean is it this two?

You would (at least) have a server (like Apache), PHP (and maybe Perl), MySQL.

I was talking about the configuration of PHP, because that is the function mail() that you want to use.

Ronald

A(Answer):

$to = "blue@example.com ";
$subject = "hello my friend";
$message = "Hello How r u?";
$headers .= "To: blue<blue@example.com >\r\n";
$headers .= "From: Birthday Reminder <mymailadd@example.com>\r\n";
mail($to, $subject, $message, $headers);

my coding is like above but got error come out.
the error is ====>
Warning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\Apache2\htdocs\mis\email.php on line "mail($to, $subject, $message, $headers);". so may i know how to set "ini_set()" ?

A(Answer):

Just do what I showed you in my previous post in this thread: read the mail functions chapter in the php manual and configure your mail configuration according to those instructions http://bytes.com/forum/post3157282-2.html

Ronald

A(Answer):

better you may do the above forum instructions.

LEAVE A COMMENT