FreePgs.com Forum

FreePgs Related => Support Requests => Topic started by: opmail on March 20, 2006, 12:53:56 PM

Title: PHP mail() problems
Post by: opmail on March 20, 2006, 12:53:56 PM
Hi there...

I have a Plesk account and I seem to be having some problems with using PHP mail()...  :(

I have tested this using the below:

<?php

$to  "fred@tosomewhere.com";
$from  "admin@somewhereelse.com";
$subject  "test email";
$body  "test body";


$headers  "From:" $from "\r\n"
mail($to$subject$body$headers);

echo("finished");

?>



substituting emails with valid addresses however I am not receiving them... Is their anything wrong with the Plesk server???
Title: Re: PHP mail() problems
Post by: Ben on March 20, 2006, 06:14:11 PM
The Mail function has been disabled on the Plesk server for now because of a mail bombing. It -should- be re-enabled in a day or two.
Title: Re: PHP mail() problems
Post by: opmail on March 20, 2006, 07:27:48 PM
Thanks for the respond... Can you please advise if mails pending will be sent? Or does php not work that way...
I use a php script to allow users to login to my site... The email is sent automatically.

Hope you can help...  :)
Title: Re: PHP mail() problems
Post by: c on March 25, 2006, 06:39:47 PM
Email is not working for me either, I am not using Plesk.
Title: Re: PHP mail() problems
Post by: webzone (archived) on March 25, 2006, 08:13:17 PM
Quote from: cEmail is not working for me either, I am not using Plesk.

Please provide more information. mail() is working fine for me.
Title: Re: PHP mail() problems
Post by: c on March 26, 2006, 08:13:22 PM
I'm using Perl. It was working some time ago.
Title: Re: PHP mail() problems
Post by: webzone (archived) on March 26, 2006, 08:36:28 PM
It looks like the path to sendmail recently changed. This might be your problem (though I don't know, I never used Perl).

Try to use /usr/sbin/sendm2 to send e-mails.
Title: Re: PHP mail() problems
Post by: c on March 27, 2006, 01:01:53 AM
Obviously this was the problem. Are there going to be more changes and where can we read about them?
Title: Re: PHP mail() problems
Post by: Ben on March 27, 2006, 01:17:00 AM
This change was to stop spamming from the server, and admin never said it publically.

Either way, if theres much more problem with spamming, you won't have to worry at all because mail() will be a disabled function, like on the plesk server.
Title: Re: PHP mail() problems
Post by: dest on March 27, 2006, 01:47:31 AM
So there's no way to control mail() on a per-user basis? Like enable it after a few months of being a member?
Title: Re: PHP mail() problems
Post by: GP™ on March 27, 2006, 02:04:19 AM
No, Not at this time, its a server wide setting.
Title: Re: PHP mail() problems
Post by: webzone (archived) on March 27, 2006, 02:40:39 AM
QuoteEither way, if theres much more problem with spamming, you won't have to worry at all because mail() will be a disabled function, like on the plesk server.

That would be sad. Some people like me rely on this function.
Title: Re: PHP mail() problems
Post by: c on March 27, 2006, 04:56:11 AM
Probably the old members can get the name of the new path each time it is changed by subscribing to a mailing list?
Title: Re: PHP mail() problems
Post by: webzone (archived) on March 28, 2006, 05:20:49 AM
QuoteProbably the old members can get the name of the new path each time it is changed by subscribing to a mailing list?

Would work for Perl users, but not for PHP users. In PHP, the sendmail path is hard-coded in the serverwide configuration file (php.ini).
Title: Re: PHP mail() problems
Post by: opmail on March 29, 2006, 10:07:09 PM
Hi there again... I notice that php mail() has been disabled again... And it seems permenantly this time... :(
I am a php novice and am relying on a script purchased to create a kind of online store.

How can I be informed of when a visitor selects something?

Can someone please assist me here as I seem to be missing a whole heap of emails... :((
Title: Re: PHP mail() problems
Post by: webzone (archived) on March 29, 2006, 11:40:32 PM
The mail function is still enabled on the main server.

It would probably be a good idea to move all your stuff anyway to the main server (because it is more flexible and up-to-date).
Title: Re: PHP mail() problems
Post by: opmail on March 30, 2006, 05:57:37 AM
Thanks for the info... My domain '5tudio.co.uk' is on the Plesk server I believe (atleast I login to Plesk to administrate/ftp etc)...
What is the main server and how would I move my stuff there???

Do I need to request anything be changed with FreePGS???

THanks again for the help.. :)
Title: Re: PHP mail() problems
Post by: Ben on March 30, 2006, 08:59:37 AM
The main server (http://system.freepgs.com) should be the one you registered with, and you would have been moved form there to Plesk by a request.

Just login to your Plesk account, download all the files and databases, and upload them to the main server. Then send a contact form request for your domains to be moved from Plesk to the main server, and for any Cron tasks you need moved. You -may- have to change nameservers on the domains for them to be moved, I'm not sure if Plesk uses the same nameservers as the main server does.
Title: Re: PHP mail() problems
Post by: webzone (archived) on March 30, 2006, 10:48:44 PM
QuoteYou -may- have to change nameservers on the domains for them to be moved, I'm not sure if Plesk uses the same nameservers as the main server does

Plesk and the main server use different nameservers and IP addresses, so the change will be necessary.
Title: Re: PHP mail() problems
Post by: c on April 02, 2006, 09:12:35 AM
Today Perl is deactivated and instead of executing the scripts I see their source on the screen!
Title: Re: PHP mail() problems
Post by: webzone (archived) on April 02, 2006, 09:28:03 AM
QuoteToday Perl is deactivated and instead of executing the scripts I see their source on the screen!

Perl was deactivated a few days ago. (http://forum.freepgs.com/?topic=998.msg5003#msg5003)
Title: Re: PHP mail() problems
Post by: bookish on April 02, 2006, 03:25:04 PM
I have been testing a FormMail script on my PC using the WAMP5 server:

http://www.wampserver.com/en/

http://www.stadtaus.com/en/php_scripts/formmail_script/

I need to set up the referring server details to use it on FreePgs:

$referring_server = 'www.example.com, example.com, 192.0.34.166';

For a FreePgs account is the IP address 64.193.110.130 or 64.193.110.132 ?
Title: Re: PHP mail() problems
Post by: Ben on April 02, 2006, 06:35:22 PM
"64.193.110.130" should be the working one. The other one leads to an unknown domain error for me.

As webzone said, perl was deactivated, if you haven't already just request it be re-enabled on your account.
Title: Re: PHP mail() problems
Post by: bookish on April 02, 2006, 08:45:55 PM
Thanks Ben! The script I'm trying out uses PHP.
Title: Re: PHP mail() problems
Post by: sixthcrusifix on April 07, 2006, 11:19:32 AM
I have a suggestion:
Instead of:

mail($to, $subject, $body, $headers);

echo("finished");



do this:


if( mail($to, $subject, $body, $headers) ){

echo("finished");

}else{

echo("ERROR IN SENDING EMAIL");

}




That way you will know when there's a problem with the mail function, instead of just always getting  a generic success message, you'll get an error message for failure and a success message for success :D
Title: Re: PHP mail() problems
Post by: possum on April 08, 2006, 06:34:22 PM
Has the mail function been disabled ??
Title: Re: PHP mail() problems
Post by: webzone (archived) on April 08, 2006, 06:57:53 PM
QuoteHas the mail function been disabled ??

Not on the main server (phpinfo (http://freepgs.com/webzone/fpgs/phpinfo)). I don't know about Plesk.
Title: Re: PHP mail() problems
Post by: possum on April 08, 2006, 07:27:02 PM

Configuration: ANJEL 0.6.1- (Joomla! )
sendmail path /usr/sbin/sendm2


xxxx@xxxx.com-> Message could not be sent.
Mailer error: Language string failed to load: execute/usr/sbin/sendm2

or

xxxx@xxxx.com-> Message could not be sent.
Mailer error: Language string failed to load: execute/usr/sbin/sendmail

Title: Re: PHP mail() problems
Post by: protegechris on April 10, 2006, 07:31:55 PM
It's disabled right now, has been since last night at least. If you're able to use SMTP, that still works for me.
Title: Re: PHP mail() problems
Post by: webzone (archived) on April 10, 2006, 07:42:23 PM
It might be disabled on Plesk, but on the Freepgs server it works fine.