+ Reply to Thread
Results 1 to 10 of 10

Thread: Email system

  1. #1
    Adamnet's Avatar
    Adamnet is offline x10Hosting Member Adamnet is an unknown quantity at this point
    Join Date
    Mar 2008
    Posts
    56

    Email system

    Hi
    I am Adamnet Im looking for a support sender php that when ytou fill stuff out and you click send it sends to my email i had a thing like it before but it dident do like i wanted it to and you had to do more sutff

  2. #2
    yokofigueroa is offline x10Hosting Member yokofigueroa is an unknown quantity at this point
    Join Date
    Mar 2008
    Posts
    24

    Re: Email system

    mm....you had to do more stuff...?
    oh...like these has nothing to do with design and stuff...
    but
    maybe u wanted a different look of m...sender...whatever...
    me myself i kno how to make those in dreamweaver..it depens what kind of web u are developing,..like html php....or maybe u are using joomla...etc

    If using dreamweaver..two tuorials
    http://dreamweaver-demos.12wonderweb...weaver-MX.html
    http://www.precisionweb.net/tutorial..._dwmx_form.htm
    ull have just to edit css

    and maybe u will like also this
    http://www.formlogix.com/
    http://www.formsite.com/
    Attached Thumbnails Attached Thumbnails Email system-contactodreamweavr.jpg  
    Last edited by yokofigueroa; 03-19-2008 at 06:20 AM.


  3. #3
    FalseHope's Avatar
    FalseHope is offline Lord Of The Keys FalseHope is an unknown quantity at this point
    Join Date
    Sep 2007
    Location
    IRC
    Posts
    1,639

    Re: Email system

    Code:
    <html>
    <body>
    
    <?php
    if (isset($_REQUEST['email']))
    //if "email" is filled out, send email
      {
      //send email
      $email = $_REQUEST['email'] ; 
      $subject = $_REQUEST['subject'] ;
      $message = $_REQUEST['message'] ;
      mail( "someone@example.com", "Subject: $subject",
      $message, "From: $email" );
      echo "Thank you for using our mail form";
      }
    else
    //if "email" is not filled out, display the form
      {
      echo "<form method='post' action='mailform.php'>
      Email: <input name='email' type='text' /><br />
      Subject: <input name='subject' type='text' /><br />
      Message:<br />
      <textarea name='message' rows='15' cols='40'>
      </textarea><br />
      <input type='submit' />
      </form>";
      }
    ?>
    
    </body>
    </html>
    http://www.w3schools.com/php/php_mail.asp
    :happysad:;):cool::nuts::rant2::drool::eek4::dunno::thefinger:laugh::hahano::lockd::naughty:

  4. #4
    TechAsh's Avatar
    TechAsh is offline Retired TechAsh is an unknown quantity at this point
    Join Date
    Oct 2007
    Location
    UK
    Posts
    5,853

    Re: Email system

    Here's the code for the system I use:

    contact.php =
    PHP Code:
    <?php
    session_start
    ();
    $cansend=$HTTP_POST_VARS['cansend'];
    if(
    $cansend==1) {
    $mailTo "Your E-Mail Address";                # Put your E-mail Address here
    $name=$HTTP_POST_VARS["name"];
    $from=$HTTP_POST_VARS["email"];
    $message=$HTTP_POST_VARS["message"];
    $subject=$HTTP_POST_VARS["subject"];
    $mailSubject="Website: $subject (From: $name)";  # Use this to customise the subject of the E-Mail.

    $mailbody=$mailbody."\n".$message;
    $headers "From: $from";

    if(
    mail($mailTo,$mailSubject,$mailbody,$headers))
    {
    $status="<div style='color:green;font-weight:bold;'>Your message has been sent successfully!<BR>I will get back to you as soon as possible.</div><BR><A href=index.php>Back to the homepage</A></center>";
    }
    else
    {
    $status="<center><div style='color:red;font-weight:bold;'>There was an error in sending your message!</div><BR><A href=index.php>Back to the homepage</A></center>";
    }
    }
    ?>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
    <HTML>
    <HEAD>
    <TITLE>Contact the Admin</TITLE>
    <META http-equiv="Content-Type" content="text/html; charset=utf-8">
    </HEAD>
    <BODY>
    <SCRIPT type="text/javascript" language="javascript" src="email-check.js"></SCRIPT>
    <TABLE cellpadding=5 cellspacing=2>
      <?php
             
    if($status) {
             
    ?>
      <TR>
        <TD colspan="2"><FONT size="+1"><B><?php echo $status;?></B></FONT></TD>
      </TR>
      <?php
             
    }
             else {
            
    ?>
      <TR>
        <TD colspan="2"><P style="color:#FF0000">* All fields are required. </TD>
      </TR>
      <FORM method="post" name="contact" action="contact.php" onSubmit="return validate();">
        <TR>
          <TD align="right"><STRONG>Your Name: </STRONG></TD>
          <TD><INPUT name="name" type="text" maxlength="30"></TD>
        </TR>
        <TR>
          <TD align="right"><STRONG>Your E-mail: </STRONG></TD>
          <TD><INPUT name="email" type="text" maxlength="40"></TD>
        </TR>
        <TR>
          <TD align="right"><STRONG>Subject: </STRONG></TD>
          <TD><INPUT name="subject" type="text" maxlength="40"></TD>
        </TR>
        <TR>
          <TD align="right" valign="top"><STRONG>Message: </STRONG></TD>
          <TD><TEXTAREA name="message" cols=50 rows="10"></TEXTAREA></TD>
        </TR>
        <TR>
          <INPUT type="hidden" name="cansend" value="0">
          <TD>&nbsp;</TD>
          <TD>
    <INPUT type='submit'>Send</INPUT>
    <INPUT type='button' onClick="redirect();">Cancel</A>
            </TD>
        </TR>
      </FORM>
      <?php
        
    }
    ?>
    </TABLE>
    </BODY>
    </HTML>
    email-check.js =
    Code:
    function redirect()
    {
    window.location="URL to your homepage";
    }
    function validate()
    {
    	document.contact.cansend.value=1;
    	return true;
    }
    function isEmail(emailstr)
    {
    	dotchar = emailstr.indexOf(".");
    	atchar = emailstr.indexOf("@");
    	dotlast = emailstr.lastIndexOf(".");
    	spacechar = emailstr.indexOf(" ");
    	len = emailstr.length;
    	if( (dotchar == -1) || (atchar == -1) || (spacechar != -1) || (dotlast < atchar) || (dotlast == len - 1) )
    	{
    		return false;
    	}
    	else
    	{
    		return true;
    	}
    }
    function trim(str)
    {
    ch = '';
    for(i=0;i<str.length;i++)
    {
    	cha = str.charAt(i);
    	if(cha != ' ')
    	{
    		ch = ch + cha;
    	}
    }
    return ch;
    }
    Copy and Paste the code to the file names specified, then edit it to change your email address URL to you homepage etc. Then upload to your server. To test it go to contact.php in your browser fill in the form and click 'send'.

    NOTE: If you haven't already you will need to upgrade to intermediate PHP for the mail() function to work.
    Useful Links:
    Terms of Service | Server News | Buy a Domain
    Free Domains: co.cc | Dot.tk -- Free File Storage: Dropbox -- Website Monitoring: Service Uptime


    My Websites:
    Earthtime Games & TechAsh's Blog

  5. #5
    Adamnet's Avatar
    Adamnet is offline x10Hosting Member Adamnet is an unknown quantity at this point
    Join Date
    Mar 2008
    Posts
    56

    Re: Email system

    Thanks and i will upgrade!

  6. #6
    kbjradmin's Avatar
    kbjradmin is offline x10 Elder kbjradmin is an unknown quantity at this point
    Join Date
    Feb 2008
    Location
    Washington State, USA
    Posts
    512

    Re: Email system

    This is a basic version of the system i use:

    'form.php'
    HTML Code:
    <html>
    <head>
    <style>
    textarea.message{
    width: 300px;
    height: 200px;
    }
    </style>
    </head>
    <body>
    <form action="formpost.php" method="post" id="form">
    <textarea id="message" value="" class="message"></textarea><br />
    <input type="submit" value="Send Message" />
    </form>
    </body>
    </html>

    'formpost.php'
    PHP Code:
    <?php
    $message 
    $_REQUEST['message'] ;
    ?>
    <html>
    <body>
    /*html code*/
    <?php
    if(mail(email@host.com,"subject",$message)
    {
    echo 
    "/*html code for success*/";
    }
    else
    {
    echo 
    "/*html code for failure*/";
    }
    ?>
    </body>
    </html>
    its short and it works.

    hope it helps!
    Last edited by kbjradmin; 03-28-2008 at 02:25 PM.

  7. #7
    Adamnet's Avatar
    Adamnet is offline x10Hosting Member Adamnet is an unknown quantity at this point
    Join Date
    Mar 2008
    Posts
    56

    Re: Email system

    Parse error: syntax error, unexpected '@' in /home/adamnet/public_html/!ITrek/php/formpost.php on line 8

    I added that and i got that

    Quote Originally Posted by kbjradmin View Post
    This is a basic version of the system i use:

    'form.php'
    HTML Code:
    <html>
    <head>
    <style>
    textarea.message{
    width: 300px;
    height: 200px;
    }
    </style>
    </head>
    <body>
    <form action="formpost.php" method="post" id="form">
    <textarea id="message" value="" class="message"></textarea><br />
    <input type="submit" value="Send Message" />
    </form>
    </body>
    </html>

    'formpost.php'
    PHP Code:
    <?php
    $message 
    $_REQUEST['message'] ;
    ?>
    <html>
    <body>
    /*html code*/
    <?php
    if(mail(email@host.com,"subject",$message)
    {
    echo 
    "/*html code for success*/";
    }
    else
    {
    echo 
    "/*html code for failure*/";
    }
    ?>
    </body>
    </html>
    its short and it works.

    hope it helps!

  8. #8
    neelabh is offline x10Hosting Member neelabh is an unknown quantity at this point
    Join Date
    Mar 2008
    Posts
    7

    Re: Email system

    but is mail() supported by x10hosting??????:dunno::lockd::happysad:

  9. #9
    TechAsh's Avatar
    TechAsh is offline Retired TechAsh is an unknown quantity at this point
    Join Date
    Oct 2007
    Location
    UK
    Posts
    5,853

    Re: Email system

    Yes.

    If you read my previous post I have already mentioned this.
    Quote Originally Posted by TechAsh
    NOTE: If you haven't already you will need to upgrade to intermediate PHP for the mail() function to work.
    You must upgrade you PHP to Intermediate to be able to use mail(). You can request an upgrade from the account panel (http://www.x10hosting.com/login).
    Useful Links:
    Terms of Service | Server News | Buy a Domain
    Free Domains: co.cc | Dot.tk -- Free File Storage: Dropbox -- Website Monitoring: Service Uptime


    My Websites:
    Earthtime Games & TechAsh's Blog

  10. #10
    VPmase's Avatar
    VPmase is offline x10 Elder VPmase is an unknown quantity at this point
    Join Date
    Nov 2007
    Location
    Dixon, IL, USA
    Posts
    914

    Re: Email system

    You guys may want to be more secure with what you are being sent. If you don't want to be send images or links or HTML in general I'd use
    PHP Code:
    strip_tag($message); 

+ Reply to Thread

Similar Threads

  1. Gmail Vs. Others
    By porky101 in forum Crossfire
    Replies: 44
    Last Post: 11-05-2011, 08:14 AM
  2. Email Servers Down?
    By pro.pcriot.com in forum Free Hosting
    Replies: 2
    Last Post: 03-03-2008, 08:55 PM
  3. email settings - still having problem
    By Burnjob in forum Free Hosting
    Replies: 11
    Last Post: 10-21-2007, 07:56 AM
  4. AnyWhere Email V. 1.0 - RELEASED
    By Brandon in forum Scripts & 3rd Party Apps
    Replies: 24
    Last Post: 03-09-2006, 08:38 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers