Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Senior Coder
    Join Date
    May 2006
    Posts
    1,673
    Thanks
    28
    Thanked 4 Times in 4 Posts

    I have a good email script and +ve tests but email still work work

    Hi

    I have tried everything and my email is not getting out

    This is my script:

    PHP Code:
    // Set up correct headers        

    $to  $N_email;

    $from="Dave@my-site.net";
    $name="Dave";

    $headers ="MIME-Version:1.0\r\n";
    $headers .="content-type:text/html; Charset=iso-8859-1\r\n";
    $headers .= "From: " "$name" "<" "$from" ">\n";
    $headers .= "Return-Path: <" "$to" ">\n";
    $headers .= "Error-To: <" "$to" ">\n";
    $headers .= "X-Sender: <" "$to" ">\n";
    $headers .= "X-Mailer: PHP v".phpversion()."\n";


    // subject
    $subject "As Promised ...Your Free Access .";
    $subjectnl2br($subject);


    $messageX "test";

    $message=$messageX;
    $message=nl2br($message);

    // Send email
    mail($to$subject$message$headers) ;

        
    if (
    mail($to$subject$message$headers)  == false
    {
     echo 
    "Email failed";
    }

    echo 
    "To: $to, <br>Subject: $subject, <br>Headers: $headers, <br>Message: $message";


    $res mail("my_name@hotmail.com""Test php mailer for MY-SITE.net""Hi,
    this message proves that php email scripts are working on the domain MY-SITE.net"
    "From: root@my-site.net""root@my-site.net");

    if(
    $res == 1){
    echo 
    "email sent successfully, check email to make sure it was recieved."; } 
    ?> 
    Well it should work and th results look like it does:

    To: kevinRobby@my-site.com,
    Subject: As Promised ...Your Free Access ,
    Headers: MIME-Version:1.0 content-type:text/html; Charset=iso-8859-1 From: Dave Return-Path: Error-To: X-Sender: X-Mailer: PHP v5.2.5 ,

    Message: testemail sent successfully, check email to make sure it was recieved.

    It even shows the correct php version !

    BUT no email arrives at either destination

    Any ideas ?
    If you want to attract and keep more clients, then offer great customer support.

    Support-Focus.com. automates the process and gives you a trust seal to place on your website.
    I recommend that you at least take the 30 day free trial.

  • #2
    Senior Coder
    Join Date
    May 2006
    Posts
    1,673
    Thanks
    28
    Thanked 4 Times in 4 Posts
    I have just been looking through the output from phptest.php on the website concerned:

    here are some of the relevent params.

    include_path .:/usr/lib/php:/usr/local/lib/php
    log_errors On
    open_basedir /home/letsget/:/usr/lib/php:/usr/local/lib/php:/tmp
    sendmail_from no value
    sendmail_path /usr/sbin/sendmail -t -i
    SMTP localhost
    smtp_port 25

    what else should I check for ?
    Thanks
    If you want to attract and keep more clients, then offer great customer support.

    Support-Focus.com. automates the process and gives you a trust seal to place on your website.
    I recommend that you at least take the 30 day free trial.

  • #3
    Regular Coder meth's Avatar
    Join Date
    Jan 2003
    Posts
    262
    Thanks
    0
    Thanked 9 Times in 9 Posts
    Try a test with the following change to the headers:

    PHP Code:

    $headers 
    .= "From: $from\n";
    $headers .= "Return-Path: $to\n";
    $headers .= "Error-To: $to\n";
    $headers .= "X-Sender: $to\n"
    I do Web Design, Brisbane based.
    More time spent in PHP/MySQL Web Development.
    And Search Engine Optimisation takes up the rest of it.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •