Connecting Tech Pros Worldwide Forums | Help | Site Map

PHP mail

Newbie
 
Join Date: Nov 2006
Posts: 23
#1: Nov 3 '06
Hi,
I have a php mail program,
<HTML>
<BODY>
<?php

$to = "me@myhost.com";
$from = "me@myhost.com";

$subject = "Hi This is a test mail";
$body = "Testing Email program and works";
$headers = "MIME-Version: 1.0\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\n";
$headers .= "From:$from\n";

mail($to, $subject, $body, $headers);
if (mail($to, $subject, $body, $headers))
{
echo("<p>Message successfully sent!to $to</p>");

} else {
echo("<p>Message delivery failed...Can't send email to $to</p>");
}
?>
</BODY>
</HTML>
The problem is i could not have any errors but i could not able to receive mail in my mailbox. I am working on PHP,MySQL,Apache, and Linux.
So have /etc/exim/exim.conf ---- (exim 3.36)
/etc/php4/apache/php.ini
how to configure?
please help me.
Thanks
Glady.

Needs Regular Fix
 
Join Date: Jul 2006
Posts: 269
#2: Nov 4 '06

re: PHP mail


Go to php.ini file to enter the mail server and restart the server.

Then only the mail send to another user\

vssp
ronverdonk's Avatar
Moderator
 
Join Date: Jul 2006
Location: The Netherlands
Posts: 4,139
#3: Nov 7 '06

re: PHP mail


Don't you have a blank character between From: and the from-address? If not, that is most likely your problem.

Ronald :cool:
Newbie
 
Join Date: Nov 2006
Posts: 23
#4: Nov 8 '06

re: PHP mail


Quote:

Originally Posted by vssp

Go to php.ini file to enter the mail server and restart the server.

Then only the mail send to another user\

vssp


--------
Hi how do i need to restart my mail server,

actually in php.ini, i have this,
[mail function]
; For Win32 only.
;SMTP = localhost
;smtp_port = 25

; For Win32 only.
;sendmail_from = myemail@mydomain.com

; For Unix only. You may supply arguments as well (default: "sendmail -t -i").
sendmail_path =
please help!!!!! i was trying to make it work for many days.
Newbie
 
Join Date: Nov 2006
Posts: 23
#5: Nov 8 '06

re: PHP mail


Quote:

Originally Posted by ronverdonk

Don't you have a blank character between From: and the from-address? If not, that is most likely your problem.

Ronald :cool:

I did by giving a blank character between From: $from
but it dint work.
please help!!!!!!
Newbie
 
Join Date: Nov 2006
Posts: 23
#6: Nov 8 '06

re: PHP mail


Quote:

Originally Posted by ronverdonk

Don't you have a blank character between From: and the from-address? If not, that is most likely your problem.

Ronald :cool:

I would like to have a drop down box1, and it has 2 items in it.
First when the form loaded, it should show that drop down box1 with 2 items in it.
If i select item #2, in dropdown box1, another drop down box should appear. if i select item#1 in drp down box 1, another drop down box should disappear.
How i can do it.
<td align="right"><b>Fruit :</b></td>
<td><select name="saletype" size="1" class="text" tabindex="9" onChange="showcombobox(this.form);">
<option value="0" SELECTED>Apple</option>
<option value="2">Orange</option>
</select>
<SPAN name="Q1" id="Q1" STYLE="position:relative; visibility: hide;">
<select name="sfruit" size="1" class="text" tabindex="10">
<option value="0" SELECTED></option>
<option value="1">grapefruit</option>
<option value="2">lemon</option>
<option value="3">lime</option>
<option value="4">melon</option>
</select>
</SPAN>
</td>
function appear(obj) {
obj.style.display = "";
}
function showcombobox(form){
if(form.saletype.value=="2"){
appear(Q1);
}
}
could you help me the code, thanks.
ronverdonk's Avatar
Moderator
 
Join Date: Jul 2006
Location: The Netherlands
Posts: 4,139
#7: Nov 8 '06

re: PHP mail


The last question does not belong in this thread, this one was about PHP AND EMAIL! Open another one for this problem. And make sure to enclose your code with tags.

If you don't know what I am talking about, then you omitted to read the Posting Guidelines, especially the part about showing code WITHIN code, html and php TAGS!!


As for this problem, see thread http://www.thescripts.com/forum/thread560758.html

Ronald :cool:
ronverdonk's Avatar
Moderator
 
Join Date: Jul 2006
Location: The Netherlands
Posts: 4,139
#8: Nov 8 '06

re: PHP mail


Quote:

Originally Posted by glady

--------
Hi how do i need to restart my mail server,

actually in php.ini, i have this,
[mail function]
; For Win32 only.
;SMTP = localhost
;smtp_port = 25

; For Win32 only.
;sendmail_from = myemail@mydomain.com

; For Unix only. You may supply arguments as well (default: "sendmail -t -i").
sendmail_path =
please help!!!!! i was trying to make it work for many days.

Are you running Windows or Unix for your email problem.

Ronald :cool:
Newbie
 
Join Date: Nov 2006
Posts: 23
#9: Nov 8 '06

re: PHP mail


Quote:

Originally Posted by ronverdonk

Are you running Windows or Unix for your email problem.

Ronald :cool:

I am running Linux, php , apache , mysql
Newbie
 
Join Date: Nov 2006
Posts: 23
#10: Nov 8 '06

re: PHP mail


Quote:

Originally Posted by glady

I am running Linux, php , apache , mysql

/etc/exim/exim.conf
for email server
/etc/php4/apache/php.ini
for php conf
ronverdonk's Avatar
Moderator
 
Join Date: Jul 2006
Location: The Netherlands
Posts: 4,139
#11: Nov 8 '06

re: PHP mail


You are cross posting. DO NOT DO THAT, IT CONFUSES OUR MEMBERS AND ME!!

You had you answer about the same problem in another thread http://www.thescripts.com/forum/post2189812-8.html in this forum, so I will close this discussion for you.

Ronald :cool:
Reply