#1  
Old 16th November 2006, 21:01
rosy rosy is offline
Junior Member
 
Join Date: Nov 2006
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default php and mail - please help

Hi,
I am working on Linux Debian (Exim 3.36 mail server).
when i tried using mail command in command line argument,
its working and when i am using php mail to send mail
its not working.
Do i need to explicitly give sendmail_path.
I got no errors.
please help.
Thanks.
Reply With Quote
Sponsored Links
  #2  
Old 16th November 2006, 22:18
sjau sjau is offline
Local Meanie
 
Join Date: Apr 2006
Location: Switzerland
Posts: 1,146
Thanks: 4
Thanked 55 Times in 51 Posts
Default

What is the error you get when you try to use php mail();?
Reply With Quote
  #3  
Old 16th November 2006, 23:42
rosy rosy is offline
Junior Member
 
Join Date: Nov 2006
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I got error which says
Message delivery failed...Can't send email
i used the command
<?php
$to = "myusername@mydomain.com";
$from = "myusername@mydomain.com";
$subject = "Hi test";
$body = "Testing Email";

$headers = "MIME-Version: 1.0\n";
$headers .= "Content-type: text/plain; charset=iso-8859-1\n";
$headers .= "From:$from";

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

} else {
echo("<p>Message delivery failed...Can't send email to $to</p>");
}
?>
please help me finding the error.
Thanks
Reply With Quote
  #4  
Old 17th November 2006, 15:18
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,740 Times in 2,575 Posts
Default

What's in your mail log when you try to send a mail using PHP?
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #5  
Old 17th November 2006, 15:44
rosy rosy is offline
Junior Member
 
Join Date: Nov 2006
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

In my mail log , i got
/var/log/exim/mainlog
2006-11-17 09:38:01 Start queue run: pid=4326
2006-11-17 09:38:01 End queue run: pid=4326
please help.why i am receiving the error message?
I could not able to receive mail in my mailbox?
i used phpinfo() in my program it gives
sendmail_from no values
sendmail_path /usr/sbin/sendmail
smtp localhost
smtp_port 25

Thanks in advance.
Reply With Quote
  #6  
Old 18th November 2006, 14:44
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,740 Times in 2,575 Posts
Default

I've seen in your other thread that you solved the problem?
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #7  
Old 19th April 2007, 07:42
CyberSpatium CyberSpatium is offline
Junior Member
 
Join Date: Apr 2007
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
 
Default

you should use the phpmailer class. it makes working with emails in your script a breeze.


http://phpmailer.sourceforge.net/
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Freebsd 6.1 support misterm Installation/Configuration 10 9th April 2009 09:29
PHP Mail() for local mail fails vincentthe Installation/Configuration 12 18th November 2006 14:35
Postfix-unable to send mail through PHP wesleyjones Installation/Configuration 8 4th October 2006 17:41
Downgrade php5 to php4.4.2 llizards Installation/Configuration 4 13th March 2006 23:58
mail() function not available in PHP??? dirk Programming/Scripts 4 26th May 2005 14:18


All times are GMT +2. The time now is 07:43.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.