Closed Thread
Results 1 to 6 of 6

Thread: Help for php mail()l script

  1. #1
    pierre39's Avatar
    pierre39 is offline x10Hosting Member pierre39 is an unknown quantity at this point
    Join Date
    Oct 2009
    Posts
    38

    Unhappy Help for php mail()l script

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

  2. #2
    descalzo's Avatar
    descalzo is offline Grim Squeaker descalzo has a brilliant futuredescalzo has a brilliant futuredescalzo has a brilliant future
    Join Date
    Jul 2009
    Location
    Ankh-Morpork
    Posts
    7,636

    Re: Help for php mail()l script

    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 by descalzo; 12-17-2010 at 06:38 PM.
    Nothing is always absolutely so.

  3. #3
    pierre39's Avatar
    pierre39 is offline x10Hosting Member pierre39 is an unknown quantity at this point
    Join Date
    Oct 2009
    Posts
    38

    Re: Help for php mail()l script

    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
    Pierre

  4. #4
    darkpunkcalob is offline x10Hosting Member darkpunkcalob is an unknown quantity at this point
    Join Date
    Jul 2009
    Posts
    22

    Re: Help for php mail()l script

    Try adding this before your mail() function:
    ini_set('SMTP', 'mail.<yourdomain>');
    I find adding the SMTP to the setting file helped mine :P

  5. #5
    pierre39's Avatar
    pierre39 is offline x10Hosting Member pierre39 is an unknown quantity at this point
    Join Date
    Oct 2009
    Posts
    38

    Re: Help for php mail()l script

    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...
    It is a good question... is not it ???

    Good evening
    Last edited by pierre39; 12-18-2010 at 04:23 PM.
    Pierre

  6. #6
    pierre39's Avatar
    pierre39 is offline x10Hosting Member pierre39 is an unknown quantity at this point
    Join Date
    Oct 2009
    Posts
    38

    Re: Help for php mail()l script

    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
    Pierre

Closed Thread

Similar Threads

  1. php mail script
    By droctoganapus86 in forum Programming Help
    Replies: 8
    Last Post: 12-29-2010, 09:33 AM
  2. e-mail form through php script
    By ajnv60 in forum Programming Help
    Replies: 2
    Last Post: 05-24-2010, 03:43 PM
  3. Mail using script
    By mrxp_anupam in forum Free Hosting
    Replies: 1
    Last Post: 10-19-2008, 09:18 AM
  4. foward mail to a php script
    By ruicos in forum Programming Help
    Replies: 3
    Last Post: 09-13-2008, 07:55 AM
  5. Send Mail Script
    By james3uk in forum Programming Help
    Replies: 3
    Last Post: 04-01-2008, 05:36 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers