Php Email Code

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Php Email Code

    hey guys, anybody willing to help me cleanup my email code?

    mail.php
    Code:
    <?php
       include("header.php")
    ?>
    
    <form method="post" action="mail-sent.php">
    
    <?php
    $ipi = getenv("REMOTE_ADDR");
    $httprefi = getenv ("HTTP_REFERER");
    $httpagenti = getenv ("HTTP_USER_AGENT");
    ?>
    
    <input type="hidden" name="ip" value="<?php echo $ipi ?>" />
    <input type="hidden" name="httpref" value="<?php echo $httprefi ?>" />
    <input type="hidden" name="httpagent" value="<?php echo $httpagenti ?>" />
    
    
    Your Name: 
    
    <input type="text" name="name" size="35" />
    
    Your Email:
    
    <input type="text" name="from" size="35" />
    
    
    
    Subject:
    <input type="text" name="subject" size="35" />
    
    
    
    Message:
    
    <input type="text" name="message" size="300" />
    
    
    <input type="submit" value="Send Message" />
    
    
    </form>
    
    
    <?php
      include("footer.php")
    ?>
    mail-sent.php
    Code:
    <?php
      include("header.php")
    ?>
    
    <?php
    if(!$from == "" && (!strstr($from,"@") || !strstr($from,".")))
    {
    echo "<h2>Message Not sent - Please Enter a VALID email address</h2>\n";
    $badinput = "<h2>Feedback was NOT submitted</h2>\n";
    }
    if(empty($name) || empty($from) || empty($message )) {
    echo "<h2>Message Not sent - Please fill in all fields</h2>\n";
    }
    echo $badinput;
    
    
    $todayis = date("g:i a, l, j F, Y, ");
    
    $subject = "FROM KWAH.FANTASTWAP.NET: $subj ";
    
    $message = stripcslashes($message);
    
    $feedback = " From: $name ($from)\n
    
    $todayis [EST] \n
    Subject: $subj \n
    Message: $feedback \n
    
    Message sent from a $httpagent \n 
    IP = $ip \n
    Referral : $httpref \n
    ";
    
    $from = "From: $from\r\n";
    
    
    mail("kwah90@gmail.com", $subject, $message, $from);
    
    ?>
    
    <p align="center">
    Thank You!
    
    
    
    
    Your message has been sent to Site Admin at <?php echo $todayis ?>.
    
    
    
    You should revieve a reply shortly, but if not, i ask that you contact me again because your feedback is important to the site.
    
    
    
    Details of your message can be found below, or alternatively, select the link below:
    
    
    [url="/index2.php"][ BACK ][/url]
    
    
    
    
    
    <hr>
    
    Time/Date: <?php echo $todayis ?>
    
    From: <?php echo $name ?> ( <?php echo $from ?> )
    
    Subject: <?php echo $subj ?>
    
    Message:
    
    <?php $msgout = str_replace("\r", "
    ", $message);
    echo $msgout; ?>
    
    
    
    </p>
    
    
    <?php
      include("footer.php")
    ?>

    #2
    index.php or email
    Code:
    <?php
    include (&#39;config.php&#39;);
    header("Content-type: text/vnd.wap.wml");
    header("display_errors=0");
    echo "<?xml version=\"1.0\"?>";
    echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\"
    \"http://www.wapforum.org/DTD/wml_1.1.xml\">";
    echo "\n";
    
    echo "<wml>";
    echo "<card title=\"Email\">";
    echo "
    
    ";
    
    echo "[size="1"]Mail to: $yourmail
    ---
    $welcome
    ---
    [b]Your name/email:[/b][/size]
    ";
    echo "<input type=\"text\" name=\"from\" value=\"\" emptyok=\"true\" maxlength=\"60\"/>";
    if ($setup=="1"){
    echo "[size="1"][b]Send to:[/b][/size]
    ";
    echo "<input type=\"text\" name=\"yourmail\" value=\"\" emptyok=\"true\" maxlength=\"60\"/>";
    }
    echo "[size="1"][b]Message:[/b][/size]
    ";
    echo "<input type=\"text\" name=\"text\" value=\"\" emptyok=\"true\" maxlength=\"500\"/>";
    
    echo "
    [size="1"]<anchor>»Send";
    echo "<go method=\"post\" href=\"send.php\">";
    echo "<postfield name=\"from\" value=\"$(from)\"/>";
    echo "<postfield name=\"text\" value=\"$(text)\"/>";
    if ($setup=="1"){
    echo "<postfield name=\"yourmail\" value=\"$(yourmail)\"/>";
    }
    echo "</go></anchor>
    ";
    echo "---
    <a href=\"$siteurl\">$sitename</a>
    ---
    © top-z.net 2006";
    echo "[/size]";
    echo "</p>";
    echo "</card>";
    echo "</wml>";
    ?>

    send.php
    Code:
    <?php
    include (&#39;config.php&#39;);
    header("Content-type: text/vnd.wap.wml; charset=ISO-8859-1");
    echo "<?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?>";
    echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\"
    \"http://www.wapforum.org/DTD/wml_1.1.xml\">\n";
    echo "\n";
    
    
    echo "<wml>";
    echo "<card title=\"Email\">";
    echo "
    
    \n";
    echo "[size="1"]\n";
    
    $time = time();
    $date = date("D d/m/Y", $time);
    $clock = date("H:i", $time);
    $browser = explode (&#39;/&#39;, $HTTP_USER_AGENT);
    $phone = $browser[0];
    $ip = $REMOTE_ADDR;
    
    if ($from=="" OR $text==""){echo "Please fill in All fields!!
    ---
    <a href=\"index.php\">«Correct details!!</a>
    ";}else{
    $message = "-From: $from\n-Date: $date\n-Time: $clock\n-On: $phone\n-Ip: $ip\n---MESSAGE---\n$text";
    mail ($yourmail, $subject, $message);
    echo "Thanks $from! Your message has been sent to $yourmail!
    ";}
    echo "---
    <a href=\"$siteurl\">$sitename</a>
    ---
    © top-z.net 2006";
    
    echo "[/size]\n";
    echo "</p>";
    echo "</card>";
    echo "</wml>";
    ?>
    config.php
    Code:
    <?
    //send to any mail "1" for yes or "0" for no
    $setup = "0";
    
    //subject
    $subject = "SITE EMAIL";
    
    //your email
    if ($setup=="0"){
    $yourmail = "your email";}
    
    //your site url
    $siteurl = "http://top-z.net";
    
    //your site name
    $sitename = "top-z.net";
    
    //your name/nick
    $yourname = "Grim-Reaper";
    
    //welcome message
    $welcome = "Please use this form only for suggestions, or to report bugs/errors.";
    ?>
    Visit: Chat4u.mobi - The New Lay Of being a site of your dreams!
    Visit: WapMasterz Coming Back Soon!
    _______
    SCRIPTS FOR SALE BY SUBZERO
    Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders.
    FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others...
    _______
    Info & Tips
    php.net
    w3schools.com

    Comment


      #3
      hmm.. thanks, but i want to use the code i posted above -- imho, it offers more ..

      Comment


        #4
        thanks sub, it works like a charm
        wapZan Mobile site builder - Yours is here



        http://wapzan.com?ref=2wap

        Comment

        Working...
        X