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 !
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";
?>
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 !
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";
?>