+ Reply to Thread
Results 1 to 9 of 9

Thread: WYSIWYGWebbuilder & Form Wizard-Email

  1. #1
    lennyboy is offline x10Hosting Member lennyboy is an unknown quantity at this point
    Join Date
    Nov 2009
    Location
    Dixie
    Posts
    37

    WYSIWYGWebbuilder & Form Wizard-Email

    Hi,

    I don't have the page in questioned linked to anything right now, but I'm having troubles getting an email form to get to me. It's at:

    http://lenford.info/page4.php

    When you fill out the form correctly and submit, it takes you to the success page. If you enter your email incorrectly, it takes you to the error page. However, when filling out the form and it looks successful, it isn't getting to me.

    I had read that you needed to use your x10 email address, so I made one that I could forward to my lenford.info account. Nothing is hitting either.

    I'm using WYSIWYGWebbuilder V.6, and everything else is working great. I'm not sure if I need to tweak something on the form page to make it work or not. Can someone look at it and see what/where/if I've gone wrong with this?

    TIA; this is a great place, by the way.
    Edit:
    I just received an email form from Mr. EEE, but for some odd reason, I can't send one to myself using the web form.

    Now THAT's weird!
    Last edited by lennyboy; 12-06-2009 at 12:53 PM. Reason: Automerged Doublepost

  2. #2
    ChatIndia's Avatar
    ChatIndia is offline Community Advocate ChatIndia is an unknown quantity at this point
    Join Date
    Sep 2009
    Location
    Exam Time. I won't tell you
    Posts
    1,296

    Re: WYSIWYGWebbuilder & Form Wizard-Email

    Why don't you try to store it in your database, and if you succeed to do it, then please give me the code, I'm having the same problem

  3. #3
    xgreenberetx is offline x10Hosting Member xgreenberetx is an unknown quantity at this point
    Join Date
    Oct 2009
    Posts
    57

    Re: WYSIWYGWebbuilder & Form Wizard-Email

    Hope this helps, if not post your script and i can fix it. There are many ways to do this. Of coarse change the email to reflect your email

    Code:
    $subject = "Contact Form Entry";                          
    $toemail = "youremail@email.com";        
    
    if($submit) 
    { 
    mail($toemail, $subject, $message."\nFrom: ".$fromname."<".$frommail.">"); 
    } 
    ?> 
    
    <html> 
    <head> 
    <title>Contact Us</title> 
    </head> 
    <form method="post" action="<? echo($PHP_SELF) ?>"> 
    E-mail:<input type="text" name="frommail" size="25"> <br> 
    
    Your Name:<input type="text" name="fromname" size="25"> <br>
    
    Your Message: <br> 
    
    <textarea cols="50" rows="5" name="message">Your Message ..</text> <br> 
    
    <input type="submit" value="Submit"> 
    
    </body> 
    </head>
    If you need an example to store info into a database I can also do that for you.

  4. #4
    lennyboy is offline x10Hosting Member lennyboy is an unknown quantity at this point
    Join Date
    Nov 2009
    Location
    Dixie
    Posts
    37

    Re: WYSIWYGWebbuilder & Form Wizard-Email

    Here's the php script for the page:

    <?php
    function ValidateEmail($email)
    {
    $pattern = '/^([0-9a-z]([-.\w]*[0-9a-z])*@(([0-9a-z])+([-\w]*[0-9a-z])*\.)+[a-z]{2,6})$/i';
    return preg_match($pattern, $email);
    }

    if($_SERVER['REQUEST_METHOD'] == 'POST')
    {
    $mailto = 'me@lennyford.x10hosting.com';
    $mailfrom = isset($_POST['email']) ? $_POST['email'] : $mailto;
    $subject = 'Hi, Len!';
    $message = 'Values submitted from web site form:';
    $success_url = './page5.html';
    $error_url = './page6.html';
    $error = '';
    $eol = "\n";
    $max_filesize = isset($_POST['filesize']) ? $_POST['filesize'] * 1024 : 1024000;
    $boundary = md5(uniqid(time()));

    $header = 'From: '.$mailfrom.$eol;
    $header .= 'Reply-To: '.$mailfrom.$eol;
    $header .= 'MIME-Version: 1.0'.$eol;
    $header .= 'Content-Type: multipart/mixed; boundary="'.$boundary.'"'.$eol;
    $header .= 'X-Mailer: PHP v'.phpversion().$eol;
    if (!ValidateEmail($mailfrom))
    {
    $error .= "The specified email address is invalid!\n<br>";
    }

    if (!empty($error))
    {
    $errorcode = file_get_contents($error_url);
    $replace = "##error##";
    $errorcode = str_replace($replace, $error, $errorcode);
    echo $errorcode;
    exit;
    }

    $internalfields = array ("submit", "reset", "send", "captcha_code");
    $message .= $eol;
    foreach ($_POST as $key => $value)
    {
    if (!in_array(strtolower($key), $internalfields))
    {
    if (!is_array($value))
    {
    $message .= ucwords(str_replace("_", " ", $key)) . " : " . $value . $eol;
    }
    else
    {
    $message .= ucwords(str_replace("_", " ", $key)) . " : " . implode(",", $value) . $eol;
    }
    }
    }

    $body = 'This is a multi-part message in MIME format.'.$eol.$eol;
    $body .= '--'.$boundary.$eol;
    $body .= 'Content-Type: text/plain; charset=iso-8859-1'.$eol;
    $body .= 'Content-Transfer-Encoding: 8bit'.$eol;
    $body .= $eol.stripslashes($message).$eol;
    if (!empty($_FILES))
    {
    foreach ($_FILES as $key => $value)
    {
    if ($_FILES[$key]['error'] == 0 && $_FILES[$key]['size'] <= $max_filesize)
    {
    $body .= '--'.$boundary.$eol;
    $body .= 'Content-Type: '.$_FILES[$key]['type'].'; name='.$_FILES[$key]['name'].$eol;
    $body .= 'Content-Transfer-Encoding: base64'.$eol;
    $body .= 'Content-Disposition: attachment; filename='.$_FILES[$key]['name'].$eol;
    $body .= $eol.chunk_split(base64_encode(file_get_contents($ _FILES[$key]['tmp_name']))).$eol;
    }
    }
    }
    $body .= '--'.$boundary.'--'.$eol;
    mail($mailto, $subject, $body, $header);
    header('Location: '.$success_url);
    exit;
    }
    ?>

    So, anything stand out that would keep this from working?

    TIA!

    Len

  5. #5
    xgreenberetx is offline x10Hosting Member xgreenberetx is an unknown quantity at this point
    Join Date
    Oct 2009
    Posts
    57

    Re: WYSIWYGWebbuilder & Form Wizard-Email

    $body .= '--'.$boundary.'--'.$eol;
    mail($mailto, $subject, $body, $header);
    header('Location: '.$success_url); <---------------try to remove this just to see if it works.
    exit;

  6. #6
    lennyboy is offline x10Hosting Member lennyboy is an unknown quantity at this point
    Join Date
    Nov 2009
    Location
    Dixie
    Posts
    37

    Re: WYSIWYGWebbuilder & Form Wizard-Email

    I'm afraid the only change was the success page didn't appear. Thank you, though. Any other thoughts?

  7. #7
    xgreenberetx is offline x10Hosting Member xgreenberetx is an unknown quantity at this point
    Join Date
    Oct 2009
    Posts
    57

    Re: WYSIWYGWebbuilder & Form Wizard-Email

    $mailto = 'me@lennyford.x10hosting.com';


    $mailto = "me@lennyford.x10hosting.com"; <------- try adding double quotes instead of single

    You might have to check your email settings and make sure everything looks copacetic.

  8. #8
    lennyboy is offline x10Hosting Member lennyboy is an unknown quantity at this point
    Join Date
    Nov 2009
    Location
    Dixie
    Posts
    37

    Re: WYSIWYGWebbuilder & Form Wizard-Email

    Quote Originally Posted by xgreenberetx View Post
    $mailto = 'me@lennyford.x10hosting.com';


    $mailto = "me@lennyford.x10hosting.com"; <------- try adding double quotes instead of single

    You might have to check your email settings and make sure everything looks copacetic.
    I'm afraid that didn't work, either. I've been looking at the webmail accounts as well to see if they've hit, and they haven't. Getting curiouser and curiouser!

    What else might I try?

    Thanks!!!

  9. #9
    lennyboy is offline x10Hosting Member lennyboy is an unknown quantity at this point
    Join Date
    Nov 2009
    Location
    Dixie
    Posts
    37

    Re: WYSIWYGWebbuilder & Form Wizard-Email

    One of the developers of WYWISYGWebbuilder asked if X10 supports php email. From what I can see it does, but then again; I'm really no expert on php.

    Len
    Edit:
    Received email from Mr. NavalDesign, but when I went to test it, nothing came through. Could this be a spam setting on the server? Any reason why it would not accept a gmail account?
    Edit:
    I don't remember, does "/usr/sbin/sendmail" have to be in the php page somewhere? I don't see it on the automatic script from the progam.

    Thanks.
    Edit:
    I got it fixed! Many thanks to all who gave me suggestions. I had tried to use the WYSIWYG editor to alter a pre-existing form from the Form Wizard in WYSIWYGWebbuilder. Something went missing, I guess. I attempted a new form from the Wizard, popped it in the page, uploaded and tried four times with different email address...and it works!

    I can now sleep at night!

    Len
    Last edited by lennyboy; 12-13-2009 at 02:19 PM. Reason: Automerged Doublepost

+ Reply to Thread

Similar Threads

  1. from form to email?
    By lmteestalk in forum Scripts & 3rd Party Apps
    Replies: 1
    Last Post: 07-24-2009, 09:58 AM
  2. Adding an email form to my website.
    By mrdimpy in forum Free Hosting
    Replies: 1
    Last Post: 05-20-2008, 08:13 AM
  3. Sending a form to an email without the mailto: statement
    By ilstu in forum Scripts & 3rd Party Apps
    Replies: 2
    Last Post: 10-26-2007, 01:57 AM

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