Help for php mail()l script

Status
Not open for further replies.

pierre39

New Member
Messages
38
Reaction score
0
Points
0
Good evening

I have problem with a form for send mail() php ...
The script is working on another server (multimania) but does not works on x10hosting Chopin server... so I wonder :

Where is the switch to put on for activate the php mail() function ?? in CPanel...?? another place ?? I think I miss it...

Precision: I am on a free webhosting server ... and I think the mail() php is not activated..?? is it possible ?? really ??

Thanks to all for future help... I need it a lot... my God !:confused:

The working script is as following (message sent and received):

<?php
//define the receiver of the email
$to = 'youraddress@example.com';
//define the subject of the email
$subject = 'Test email';
//define the message to be sent. Each line should be separated with \n
$message = "Hello World!\n\nThis is my first mail.";
//define the headers we want passed. Note that they are separated with \r\n
$headers = "From: webmaster@example.com\r\nReply-To: webmaster@example.com";
//send the email
$mail_sent = @mail( $to, $subject, $message, $headers );
//if the message is sent successfully print "Mail sent". Otherwise print "Mail failed"
echo $mail_sent ? "Mail sent" : "Mail failed";
?>
 

descalzo

Grim Squeaker
Community Support
Messages
9,373
Reaction score
326
Points
83
mail() is activated.

What does the script say? 'Mail failed' ?

The 'From' should be from your x10 hosting account. I believe the mail server is set up to reject outgoing mail that says it is 'From' hotmail, etc.

And if the target is hotmail or yahoo, it might be blocked by the receiver.
 
Last edited:

pierre39

New Member
Messages
38
Reaction score
0
Points
0
Good evening Descalzo,
Thank you for your message... the php mail() script was a sample ... I put my account name & adress in the 'From' for a test...
The script say 'Mail sent' but in fact I don't receive the email (target is my account myname@bell.net)

So I don't understand any more... anyway !
Thanks again
 

pierre39

New Member
Messages
38
Reaction score
0
Points
0
Hello darkpunkcalob

I've just tried my test page with your script (adding the ini_set function for SMTP ) but it does not work...
Thank-you for your idea, have a good day...

Just a question : where is it possible to see the php mail() is activated... a lot of people say it is but, for fun where to look for check by myself...:confused:
It is a good question... is not it ???:biggrin:

Good evening:cool:
 
Last edited:

pierre39

New Member
Messages
38
Reaction score
0
Points
0
THIS ISSUE IS RESOLVED... just a minor change in the PHP script and mail server rules... now it's working fine...
Confirm PHP mail() is activated... Thanks you everybody and have a good day...
Please close thread
 
Status
Not open for further replies.
Top