Jump to content

mail() [function.mail] error??


JJohnsenDK

Recommended Posts

Hey

Im trying make an email function on my website. Im using the mail() function in php. When i try the script i get this error:

Warning: mail() [function.mail]: SMTP server response: 553 We do not relay non-local mail, sorry. in C:\Programmer\xampp\htdocs\katrinelund\mail.php on line 30

What does this mean? i run on localhost and using the XAMPP software, which are using Mercury as SMTP server.

Hope someone can help  :)
Link to comment
https://forums.phpfreaks.com/topic/27861-mail-functionmail-error/
Share on other sites

Ofcause, here it is:

[code]<?php
if (isset($_POST['navn']) && isset($_POST['besked']))
{
    if (empty($_POST['navn']))
    {
        echo "Du skal indtaste dit navn";
    }
    elseif (empty($_POST['besked']))
    {
        echo "Du skal indtaste en besked";
    }
    else
    {
        $modtager = "[email protected]";
        $emne = "Mail fra en bruger";
        $besked = "Hej, du har modtaget mail fra en bruger: \n
                            Navn: " . $_POST['navn']. "\n
                            Besked: " . $_POST['besked'];
        $header = "from:[email protected]";

        mail($modtager, $emne, $besked, $header);
        echo "Emailen er nu sendt!";
    }
}
?>

<form action="mail.php" method="post">
    Navn: <br>
    <input type="text" name="navn" style="width: 200px;"> <br><br>

    Besked: <br>
    <textarea name="besked" style="width: 200px; height: 100px;"></textarea> <br><br>

    <input type="submit" value="Send mail">
</form>[/code]

I hope it can help

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.