I am setting up a site with the phpwslistings module on 9.3.2 and when I test the send to a friend or contact agent no emails go through. Does anyone know what I need to do to correct this problem?
Thanks.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I discovered that my isp requires an additional parameter for sendmail. Here is a clip from their support forum. (this is a unix system).
In an attempt decrease the amount of spam sent from our unix webservers AND to increase our chances of tracking down spammers, we do not allow the apache user (httpd) to send mail from the webserver. PHP (unlike PERL) runs as the apache user. This means that when Apache tries to sendmail from your website, its going to try and send it as the user "httpd", however it won't work. The way around this is to send a flag to sendmail. From a UNIX command line, it would look something like this:
/usr/sbin/sendmail -t -f username
...where "username "is your FTP username. PHP's mail() function uses /usr/sbin/sendmail -t -f httpd by default. You must send a flag to the mail() function to change "httpd"to your own username or e-mail address. It would look like this:
I discovered a fix to the problem and wanted to post it in the forum for future reference. Starting at around line 1062 in ListingManager.php I changed $mail_object =& Mail::factory('mail'); to $mail_object =& Mail::factory('sendmail');
I also appended the optional sendmail parameter to send as below.
I am setting up a site with the phpwslistings module on 9.3.2 and when I test the send to a friend or contact agent no emails go through. Does anyone know what I need to do to correct this problem?
Thanks.
Which OS and what sendmail program is running.. Never had that problem except with WINDOWS running apache I had to update the sendmail program.
I discovered that my isp requires an additional parameter for sendmail. Here is a clip from their support forum. (this is a unix system).
In an attempt decrease the amount of spam sent from our unix webservers AND to increase our chances of tracking down spammers, we do not allow the apache user (httpd) to send mail from the webserver. PHP (unlike PERL) runs as the apache user. This means that when Apache tries to sendmail from your website, its going to try and send it as the user "httpd", however it won't work. The way around this is to send a flag to sendmail. From a UNIX command line, it would look something like this:
/usr/sbin/sendmail -t -f username
...where "username "is your FTP username. PHP's mail() function uses /usr/sbin/sendmail -t -f httpd by default. You must send a flag to the mail() function to change "httpd"to your own username or e-mail address. It would look like this:
mail($to,$subject,$message,$headers,"-fyou@yourdomain.com";);
This is discussed at http://us3.php.net/manual/en/ref.mail.php
I discovered a fix to the problem and wanted to post it in the forum for future reference. Starting at around line 1062 in ListingManager.php I changed $mail_object =& Mail::factory('mail'); to $mail_object =& Mail::factory('sendmail');
I also appended the optional sendmail parameter to send as below.
$headers['From'] = $from;
$headers['To'] = $to;
$headers['Subject'] = $subject;
$mail_object =& Mail::factory('sendmail');
if ($mail_object->send($to, $headers, $message, "-fuser@domain.com";)) {