Closed Thread
Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: Contact form won't send the email!!!!

  1. #1
    daraclare is offline Learning Programmer
    Join Date
    Jun 2009
    Posts
    43
    Rep Power
    0

    Contact form won't send the email!!!!

    Hi, I can't get a contact form to send the email and can't see the problem....

    Can anyone advise? I always seem to have a problem with contact forms

    Thanks in advance.

    DC

    The HTML code is below:
    HTML Code:
    <!-- start content -->
    	<div id="content">
    	  <div class="post">
    	    <h1 class="title">contact front Line Display?</h1>
    	    <form action="form2mail.php" method="POST" onsubmit="MM_validateForm('name','','R','telephone','','RisNum','email','','NisEmail');return document.MM_returnValue"><table width="300" border="5" bordercolor="#FFFFFF">
    	      <tr>
    	        <td><table width="630" border="0" align="left" cellpadding="5" cellspacing="15" id="contact-back">
    	          <tbody>
    	            <tr bgcolor="#ffffff">
    	              <td align="right"><font face="Verdana, Arial, Helvetica, sans-serif" size="2">Name: </font></td>
    	              <td align="left"><font face="Verdana, Arial, Helvetica, sans-serif" size="2">
    	                <input name="name" type="text" id="name" onblur="MM_validateForm('name','','R','telephone','','NisNum','email','','NisEmail');return document.MM_returnValue" />
    	                </font></td>
                    </tr>
    	            <tr bgcolor="#ffffff">
    	              <td align="right"><font face="Verdana, Arial, Helvetica, sans-serif" size="2">Company: </font></td>
    	              <td align="left"><font face="Verdana, Arial, Helvetica, sans-serif" size="2">
    	                <input name="Company" id="Company" type="text" />
    	                </font></td>
                    </tr>
    	            <tr bgcolor="#ffffff">
    	              <td align="right"><font face="Verdana, Arial, Helvetica, sans-serif" size="2">Telephone: </font></td>
    	              <td align="left"><font face="Verdana, Arial, Helvetica, sans-serif" size="2">
    	                <input name="telephone" id="telephone" type="text" />
    	                </font></td>
                    </tr>
    	            <tr bgcolor="#ffffff">
    	              <td align="right"><font face="Verdana, Arial, Helvetica, sans-serif" size="2">Email: </font></td>
    	              <td align="left"><font face="Verdana, Arial, Helvetica, sans-serif" size="2">
    	                <input name="email" id="email" type="text" />
    	                </font></td>
                    </tr>
    	            <tr bgcolor="#ffffff"></tr>
    	            <tr bgcolor="#ffffff">
    	              <td align="right"><font face="Verdana, Arial, Helvetica, sans-serif" size="2">Message:</font></td>
    	              <td align="left"><font face="Verdana, Arial, Helvetica, sans-serif" size="2">
    	                <textarea name="message" cols="40" rows="5" id="message" onblur="MM_validateForm('name','','R','telephone','','NisNum','email','','NisEmail');return document.MM_returnValue"></textarea>
    	                </font></td>
                    </tr>
    	            <tr bgcolor="#ffffff">
    	              <td colspan="2" align="center"><input name="Submit" value="Submit" type="submit" /></td>
                    </tr>
                  </tbody>
    	          </table></td>
              </tr>
    </table>
    	    <div class="entry"><form action="form2mail.php" method="POST" onsubmit="MM_validateForm('name','','R','telephone','','RisNum','email','','NisEmail');return document.MM_returnValue">
    <p>&nbsp;</p>
    </div>
    		  <p class="links">&nbsp;</p>
    			<p class="tags"><a href="mailto:mikegeogh@gmail.com">click to email</a> 69 Cappaghmore, Clondalkin, Dublin 22. <span class="footer_blue_caps">T:</span> (01) 45 776 50 <span class="footer_blue_caps">M:</span> + 353 (0) 87 2466 862 <span class="footer_blue_caps">F:</span> (01) 45 776 50</p>
    </div>
    	</div>
    	<!-- end content -->
    Last edited by Orjan; 02-17-2010 at 05:41 PM. Reason: Please use code tags when posting code!!

  2. CODECALL Circuit advertisement
    Join Date
    Always
    Posts
    Many

     
  3. #2
    daraclare is offline Learning Programmer
    Join Date
    Jun 2009
    Posts
    43
    Rep Power
    0

    Re: Contact form won't send the email!!!!

    Oh yeah I'm using Dreamweaver CS4 if that makes any difference..

  4. #3
    Bioshox is offline Programmer
    Join Date
    Oct 2009
    Location
    Manchester, UK
    Posts
    196
    Rep Power
    10

  5. #4
    daraclare is offline Learning Programmer
    Join Date
    Jun 2009
    Posts
    43
    Rep Power
    0

    Re: Contact form won't send the email!!!!

    Thanks but I don't want to pay to do it

    Would like to figure it out if possible...

    I think I'm looking at it too long!

  6. #5
    daraclare is offline Learning Programmer
    Join Date
    Jun 2009
    Posts
    43
    Rep Power
    0

    Re: Contact form won't send the email!!!!

    Actually it's free but you have to leave their link on so that'd mess up the look of the site I think, but thanks for the suggestion )

  7. #6
    Jaan Guest

    Re: Contact form won't send the email!!!!

    Umm.. can you show us that form2post.php file ?

  8. #7
    daraclare is offline Learning Programmer
    Join Date
    Jun 2009
    Posts
    43
    Rep Power
    0

    Re: Contact form won't send the email!!!!

    Thanks Jann, see below:
    Code:
    <?php 
    # You can use this script to submit your forms or to receive orders by email.
    $MailToAddress "info@dot-circle.com"// your email address
    $redirectURL "http://www.frontlinedisplay.ie/thankyou.htm"// the URL of the thank you page.
    $MailSubject "Enquiry from website contact form"// the subject of the email

    # copyright 2005 Web4Future.com =================================================================================================

    # If you are asking for a name and an email address in your form, you can name the input fields "name" and "email".
    # If you do this, the message will apear to come from that email address and you can simply click the reply button to answer it.

    # To block an IP, simply add it to the blockip.txt text file.

    # If you have a multiple selection box or multiple checkboxes, you MUST name the multiple list box or checkbox as "name[]" instead of just "name" 
    # you must also add "multiple" at the end of the tag like this: <select name="myselectname[]" multiple> 
    # you have to do the same with checkboxes

    # This script was written by George A. & Calin S. from Web4Future.com
    # There are no copyrights in the sent emails.

    /*****************************************************************

        Web4Future Easiest Form2Mail (GPL).
        Copyright (C) 1998-2005 Web4Future.com All Rights Reserved. 
        [url=http://www.Web4Future.com/]Web4Future Inc.[/url]

        This program is free software; you can redistribute it and/or modify
        it under the terms of the GNU General Public License as published by
        the Free Software Foundation; either version 2 of the License, or
        (at your option) any later version.

        This program is distributed in the hope that it will be useful,
        but WITHOUT ANY WARRANTY; without even the implied warranty of
        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
        GNU General Public License for more details.

    *****************************************************************/

    # DO NOT EDIT BELOW THIS LINE UNLESS YOU KNOW WHAT YOU ARE DOING ===================================================
    $w4fver =  "2.0.4";
    $w4fx strstr(file_get_contents('blockip.txt'),getenv('REMOTE_ADDR')); 

    if (
    preg_match ("/".str_replace("www."""$_SERVER["SERVER_NAME"])."/i"$_SERVER["HTTP_REFERER"]) && ($w4fx === FALSE)) {
    $w4fMessage "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\"><html>\n<head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\"></head><body>\n";
    if (
    count($_GET) >0) {
        
    reset($_GET);
        while(list(
    $key$val) = each($_GET)) {
            
    $GLOBALS[$key] = $val;
            if (
    is_array($val)) { 
                
    $w4fMessage .= "<b>$key:</b> ";
                foreach (
    $val as $vala) { 
                    
    $vala =stripslashes($vala);
                    
    $vala htmlspecialchars($vala);
                    
    $w4fMessage .= "$vala, ";
                } 
                
    $w4fMessage .= "<br>\n";
            }     
            else {
                
    $val stripslashes($val);
                if ((
    $key == "Submit") || ($key == "submit")) { }     
                else {     if (
    $val == "") { $w4fMessage .= "$key: - <br>\n"; }
                        else { 
    $w4fMessage .= "<b>$key:</b> $val<br>\n"; }
                }
            }
        } 
    // end while
    }//end if
    else {
        
    reset($_POST);
        while(list(
    $key$val) = each($_POST)) {
            
    $GLOBALS[$key] = $val;
            if (
    is_array($val)) { 
                
    $w4fMessage .= "<b>$key:</b> ";
                foreach (
    $val as $vala) { 
                    
    $vala =stripslashes($vala);
                    
    $vala htmlspecialchars($vala);
                    
    $w4fMessage .= "$vala, ";
                } 
                
    $w4fMessage .= "<br>\n";
            }     
            else {
                
    $val stripslashes($val);
                if ((
    $key == "Submit") || ($key == "submit")) { }     
                else {     if (
    $val == "") { $w4fMessage .= "$key: - <br>\n"; }
                        else { 
    $w4fMessage .= "<b>$key:</b> $val<br>\n"; }
                }
            }
        } 
    // end while
        
    }//end else
    $w4fMessage .= "<font size=3D1><br><br>\n Sender IP: ".getenv('REMOTE_ADDR')."</font></font></body></html>";    
       
    $w4f_what = array("/To:/i""/Cc:/i""/Bcc:/i","/Content-Type:/i","/\n/");
        
    $name preg_replace($w4f_what""$name);
        
    $email preg_replace($w4f_what""$email);
    if (!
    $email) {$email $MailToAddress;}
        
    $mailHeader "From: $name <$email>\r\n";
        
    $mailHeader .= "Reply-To: $name <$email>\r\n";
        
    $mailHeader .= "Message-ID: <"md5(rand()."".time()) ."@"ereg_replace("www.","",$_SERVER["SERVER_NAME"]) .">\r\n";
        
    $mailHeader .= "MIME-Version: 1.0\r\n";
        
    $mailHeader .= "Content-Type: multipart/alternative;";            
        
    $mailHeader .= "     boundary=\"----=_NextPart_000_000E_01C5256B.0AEFE730\"\r\n";                    
        
    $mailHeader .= "X-Priority: 3\r\n";
        
    $mailHeader .= "X-Mailer: PHP/" phpversion()."\r\n";
        
    $mailHeader .= "X-MimeOLE: Produced By Web4Future Easiest Form2Mail $w4fver\r\n";
        
    $mailMessage "This is a multi-part message in MIME format.\r\n\r\n";
        
    $mailMessage .= "------=_NextPart_000_000E_01C5256B.0AEFE730\r\n";
        
    $mailMessage .= "Content-Type: text/plain;   charset=\"ISO-8859-1\"\r\nContent-Transfer-Encoding: quoted-printable\r\n\r\n";            
        
    $mailMessage .= strip_tags($w4fMessage)."\r\n\r\n";            
        
    $mailMessage .= "------=_NextPart_000_000E_01C5256B.0AEFE730\r\n";            
        
    $mailMessage .= "Content-Type: text/html;   charset=\"ISO-8859-1\"\r\nContent-Transfer-Encoding: quoted-printable\r\n\r\n";            
        
    $mailMessage .= "$w4fMessage\r\n\r\n";            
        
    $mailMessage .= "------=_NextPart_000_000E_01C5256B.0AEFE730--\r\n";            

        if (!
    mail($MailToAddress$MailSubject$mailMessage,$mailHeader)) { echo "Error sending e-mail!";}
        else { 
    header("Location: ".$redirectURL); }    
    } else { echo 
    "<center><font face=verdana size=3 color=red><b>ILLEGAL EXECUTION DETECTED!</b></font></center>";}
    ?>
    Last edited by Orjan; 02-18-2010 at 12:23 AM. Reason: Please use code tags when posting code

  9. #8
    Jaan Guest

    Re: Contact form won't send the email!!!!

    But can you tell me what error it shows ?

  10. #9
    daraclare is offline Learning Programmer
    Join Date
    Jun 2009
    Posts
    43
    Rep Power
    0

    Re: Contact form won't send the email!!!!

    It doesn't show an error - it goes to the "thankyou.htm" but it doesn't send the email... and the email address is definitely correct

  11. #10
    daraclare is offline Learning Programmer
    Join Date
    Jun 2009
    Posts
    43
    Rep Power
    0

    Re: Contact form won't send the email!!!!

    Any ideas folks?

Closed Thread
Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

There are currently 2 users browsing this thread. (0 members and 2 guests)

Similar Threads

  1. send email from my application
    By issacthiyagarajan in forum PHP Development
    Replies: 1
    Last Post: 06-23-2010, 04:02 AM
  2. PHP contact form isn't sending out email
    By jonathan1987 in forum PHP Development
    Replies: 1
    Last Post: 05-26-2010, 05:15 PM
  3. Python Send An Email
    By QuackWare in forum Classes and Code Snippets
    Replies: 0
    Last Post: 03-07-2010, 07:18 PM
  4. Send Email Via SMTP
    By VBnet in forum Visual Basic Tutorials
    Replies: 3
    Last Post: 01-22-2010, 10:05 AM
  5. send email >>>>>but!!!!
    By kiss in forum Visual Basic Programming
    Replies: 7
    Last Post: 01-10-2008, 05:44 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts