PHP mail() function eka gana help ekak one

charu@sliit

Junior member
  • Aug 14, 2010
    216
    1
    18
    machao mekai seen eka

    mama 000wwwhost eke dala thama mail eka check kale yahoo walta withrak mail eka yanne naha anith okktama yanawa



    menna code eka


    save as a html

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    </head>


    </form>
    </html>
    <body>
    <form action="to.php" method="post">

    Topic: <br/><input type="text" name="topic"/><br/>
    Message: <br/><textarea name="message"></textarea><br/>
    <input type="submit" value="Send" name="submit"/>

    </form>


    </body>
    </html>





    this is php script
    <?php
    if ($_POST['submit']){
    ini_set("SMTP", "server20.000webhost.com");
    ini_set("smtp_port", 465);

    //your mail
    $to = "[email protected]";
    $subj = $_POST['topic'];
    $body = $_POST['message'];
    $header = "From: [email protected]";

    if (mail($to, $subj, $body, $header))
    {

    echo "Message sent successfully";
    }
    else
    {
    echo "Message sent unsuccessfully";
    }
    }
    else
    {


    }
    ?>
     

    cm2004cm4ever

    Member
    Aug 21, 2008
    1,079
    88
    0
    try this http://find-people-free.hostzi.com/index.php
    mamath testing walata host karapu ekak 000webhost wala mata mail enawa yahoo and all..borunam try karala balanna

    $to = $email;
    $subject = "Activate your account..";
    $headers = 'MIME-Version: 1.0' . "\r\n";
    $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
    $headers = "From: [email protected]";
    $body = "Hellow ! $name,\n\nPlease use link below to activate your account..\n\nhttp://find-people-free.hostzi.com/active.php?id=$id_v&code=$number\n\nThank You !\nMadhushanka Rathnayake..";
    mail($to,$subject,$body,$headers);
     
    Last edited:

    nanopro

    Well-known member
  • Jun 2, 2009
    516
    363
    63
    colombo
    Some time it may be issue of the 000webhost.com.i had also this kind of problem.but that case ,when i sent a email using my php script sometimes it deliver to mentioned email.some cases it didn't.but 2 or 3 days later message was gone to email. im using 000webhost free account.
    is it the case for this problem?(just only ma idea)