server config to use php mail()?

General discussion forum for the Zend Server

server config to use php mail()?

Postby smithdg on Thu Mar 26, 2009 7:47 pm

Do I need to edit anything on a debian lenny install from deb files to get the standard php mail() command to work? I can use mailx from the command line, and postfix is sending it ok, so I suspect there must be something in php.ini that needs to be changed.

EDIT:
I have ran a tail on /var/log/mail.info, and never see the email go through. This is a sample script:

<?php
$to = 'validemail_for_me@my_email_server';
$subject = 'the subject';
$message = 'hello';
$headers = 'From: www-data@the_fqn_of_zend_server_beta' . "\r\n" .
'Reply-To: validemail_for_me@my_email_server' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
mail($to, $subject, $message, $headers);
?>
smithdg
 
Posts: 41
Joined: Sun Mar 22, 2009 3:32 am

Re: server config to use php mail()?

Postby jess04 on Thu Mar 26, 2009 11:29 pm

Hello,

Please insert the following directive in /usr/local/zend/etc/php.ini:
sendmail_path = /usr/sbin/sendmail -t -i

Or, if you have it:
sendmail_path = /usr/lib/sendmail -t -i

If you're sendmail has a different path, please modify accordingly.

Of course, you'll need to reload Apache.

Let me know if this helps,
Last edited by jess04 on Mon Apr 12, 2010 1:31 pm, edited 1 time in total.
May the source be with you,

Jess Portnoy
jess04
 
Posts: 628
Joined: Thu Jan 15, 2009 3:37 pm

Re: server config to use php mail()?

Postby smithdg on Fri Mar 27, 2009 5:32 pm

That fixed it. Thanks very much.
smithdg
 
Posts: 41
Joined: Sun Mar 22, 2009 3:32 am

Re: server config to use php mail()?

Postby mecommayou on Mon Mar 15, 2010 3:50 pm

Is there workaround for Windows platform?
mecommayou
 
Posts: 12
Joined: Wed Jul 15, 2009 7:29 pm

Re: server config to use php mail()?

Postby massimilianoc on Tue Mar 16, 2010 2:11 pm

For Windows you must have an SMTP server to connect to.

There is no 'sendmail' utility on Windows.
Best regards,
Massi.
massimilianoc
 
Posts: 699
Joined: Thu Mar 12, 2009 11:58 am

Re: server config to use php mail()?

Postby mecommayou on Tue Mar 16, 2010 2:35 pm

massimilianoc wrote:For Windows you must have an SMTP server to connect to.

There is no 'sendmail' utility on Windows.

But what about this one? http://glob.com.au/sendmail/
mecommayou
 
Posts: 12
Joined: Wed Jul 15, 2009 7:29 pm


Return to Zend Server

Who is online

Users browsing this forum: No registered users and 2 guests