I can not use mail() function in php , Help me please !

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • manohar208
    New Member
    • Nov 2006
    • 2

    I can not use mail() function in php , Help me please !

    <html>
    <head>
    <title>Trang goi mail</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    </head>

    <body>
    <?php
    $to = "vytien123@yaho o.com";
    $from = "vytien83@yahoo .com";
    $subject = "This is a test email";
    $message = "Dear Vy,\n\nThis is a fake email, I hope you enjoy it.\n\nFrom Tien.";

    $headers = "From: $from\r\n";

    $success = mail($to, $subject, $message, $headers);
    if ($success)
    echo "The email to $to from $from was successfully sent";
    else
    echo "An error occurred when sending the email to $to from $from";
    ?>

    </body>
    </html>


    // this is result when I run this page

    Warning: mail() [function.mail]: SMTP server response: 550 Unable to relay in d:\webserver\ev eryone_web\quan lykhachhang\thu \thumail.php on line 16
    An error occurred when sending the email to(E-Mail address blocked: See forum rules) from(E-Mail address blocked: See forum rules)

    Thanks a lot
  • ronverdonk
    Recognized Expert Specialist
    • Jul 2006
    • 4259

    #2
    Glad you ran into a forum rule. We also have forum rules, which you can see at the top of this forum. It is called Posting Guidelines. Read it before you put any unstructured code in this forum. Enclose the code in php, code or html tags, like instructed.

    Ronald :cool:

    Comment

    Working...