Problem with verification mail sending

Discussion in 'PHP' started by pvakr, Dec 1, 2009.

  1. #1
    Hi friends,

    I have a problem with sending verification mail.

    When the user registers the script has to send a mail.

    Actually it is able to send mails to the mails on the same server where i hosted my site.But it is not able to send the verification mail to other mail ids which are not on my server.like @gmail.com,@yahoo.com.... etc


    Is it a script problem? OR server setup problem?

    Please someone reply.
     
    pvakr, Dec 1, 2009 IP
  2. dsignresponder

    dsignresponder Greenhorn

    Messages:
    81
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    18
    #2
    Can you post here the script (or the part of it) which is supposed to send those mails?
     
    dsignresponder, Dec 1, 2009 IP
  3. pvakr

    pvakr Peon

    Messages:
    220
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    this is the script i used for password recovery.... it is also working same as register verification mail thing.it is able to send mails to the addresses hosted on my server.And not able to send to toher mails.


    code :::




    $email = addslashes(trim($_GET['email_recover']));

    $sql = mysql_query("SELECT * FROM members WHERE email = '$email'");
    $row = mysql_fetch_array($sql);
    $member = new Member($row,'db');

    $fname = $row[fname];
    $lname = $row[lname];
    $password = $row[password];


    if ($email == "") {
    $msg = "Please enter your email address!";
    }
    elseif ($row == NULL) {
    $msg = "This email address does not exist in our database!";
    }
    else {

    $subject = "filemirror.in Password Recovery";
    $html_data = "Using the forgot password on our site, you have received this email containing your account details. <br /><br />
    Your details are: <br />
    Username: <strong>".$row['username']."</strong> <br />
    Email: <strong>".$row['email']."</strong> <br />
    Password: <strong>".$row['password']."</strong><br /><br />
    Thanks, the FileMirror Team.
    http://www.Filemirror.in";

    $mime = new MIME_mail("support@filemirror.in", $member->email, $subject);
    $mime->attach($html_data, "", HTML, BASE64);
    $mime->send_mail();

    $msg = "<span style=\"color: #92ba1e; font-weight: bold;\">Your password has been sent to your email address!</span>";
    }

    echo $msg;
    }
     
    pvakr, Dec 1, 2009 IP
  4. dsignresponder

    dsignresponder Greenhorn

    Messages:
    81
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    18
    #4
    Have you checked if your MIME_mail class is installed(uploaded) correctly to your server? Have you included ALL the necessary config files the MIMO_mail requires?
    Advice :
    use "(php)" at the beginning of your PHP lines and "(/php)" at the end for better reading. instead of ( --> [ and ) --> ]
    :)
     
    dsignresponder, Dec 1, 2009 IP
  5. pvakr

    pvakr Peon

    Messages:
    220
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #5
    i'll send mail class ... is it possible to check it ?
     
    pvakr, Dec 1, 2009 IP
  6. dsignresponder

    dsignresponder Greenhorn

    Messages:
    81
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    18
    #6
    Try to send an email with
    
    mail($email, $subject, $html_data, $headers); // $headers --> optional BUT :
    $headers  = 'MIME-Version: 1.0' . "\r\n";
    $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
    $headers .= 'From: 'sender_email_name' <'sender_email_addr'>'. "\r\n";
    
    PHP:
    instead of the MIME_mail class to see if it will send the emails to recipients outside of your server/domain.
     
    dsignresponder, Dec 1, 2009 IP