By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,273 Members | 1,037 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,273 IT Pros & Developers. It's quick & easy.

email problem in php

P: 18
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?
Apr 24 '08 #1
Share this Question
Share on Google+
6 Replies


ronverdonk
Expert 2.5K+
P: 4,258
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
Apr 24 '08 #2

P: 18
i using apache and mysql. u mean is it this two?
Apr 24 '08 #3

ronverdonk
Expert 2.5K+
P: 4,258
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
Apr 24 '08 #4

P: 18
Expand|Select|Wrap|Line Numbers
  1. $to  = "blue@example.com ";
  2. $subject = "hello my friend";
  3. $message = "Hello How r u?";
  4. $headers .= "To: blue<blue@example.com >\r\n";  
  5. $headers .= "From: Birthday Reminder <mymailadd@example.com>\r\n";
  6.  
  7. 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()" ?
Apr 25 '08 #5

ronverdonk
Expert 2.5K+
P: 4,258
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
Apr 25 '08 #6

mageswar005
P: 72
better you may do the above forum instructions.
Apr 25 '08 #7

Post your reply

Sign in to post your reply or Sign up for a free account.