SitePoint Sponsor

User Tag List

Results 1 to 13 of 13
  1. #1
    SitePoint Member
    Join Date
    Nov 2009
    Posts
    24
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    E-mail link not working

    Hello all,

    I have finally got my website up and running but I find that my e-mail link is not working. Could one of you kind people here help me out to see what i have done wrong.

    The website address is www.totosprachservice.com

    Help is much appreciated

    Thanks
    Siamanti

  2. #2
    Web development Company chrisranjana's Avatar
    Join Date
    Jan 2001
    Location
    chennai , tamil nadu , India
    Posts
    705
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I get the error

    Not Found

    The requested URL /send.php was not found on this server.
    Chris, Programmer/Developer, Chrisranjana.com
    Chennai, Tamil Nadu, India.
    Php Developers, Ruby on Rails Developers

  3. #3
    SitePoint Member
    Join Date
    Nov 2009
    Posts
    24
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Me too but what do I need to do to correct it

    Thanks for replying!

    Siamanti

  4. #4
    SitePoint Member
    Join Date
    Nov 2009
    Posts
    24
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok I believe that I need to create a php file and upload it to my host server that links the contact form to my domain postbox. Can anyone help me with the code here or give me an example.

    Your help would be greatly appreciated.

    Siamanti

  5. #5
    SitePoint Wizard rguy84's Avatar
    Join Date
    Sep 2005
    Location
    Durham, NC
    Posts
    1,659
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)
    are you wanting to create something such as clicking on totraining@aol.com and that launches their mail client?
    If so change:
    HTML Code:
    <a href="contact.html" rel="#overlay"><b> e.mail: totraining@aol.com</b><br />
        </a>
    To
    HTML Code:
    <a href="mailto:totraining@aol.com" rel="#overlay"><b> e.mail: totraining@aol.com</b><br /></a>
    Ryan B | My Blog | Twitter

  6. #6
    SitePoint Member
    Join Date
    Nov 2009
    Posts
    24
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you for your reply. I was actually hoping to use the contact form, I have already got. It appears I need to create a couple of PHP files. Is that correct, as when I click on send-it comes up with the message. send.php not found on this server.

  7. #7
    SitePoint Wizard
    Join Date
    Jul 2003
    Location
    Kent
    Posts
    1,921
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Yes, you must write your own data handling script to send the email from the form.
    google on email using php and try any of the 84 million examples. (It's quite easy once you've done it once.) Remember to check that all the required fields are completed. You can check this using javascript and php. JS has the advantage that the check takes place before the user leaves the page. But include php validation as well, in case someone has js disabled.

  8. #8
    SitePoint Member
    Join Date
    Nov 2009
    Posts
    24
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you for your answer. Sorry for being dull on this but I have just managed to get my head around HTML. I have already designed the contact forms on the website using normal code. What php file do I need to create now. Is it only an send.php code file and what further linking do I need to do on the contact form page?

    I have browsed the web but can ony find php code templates with contact forms included so far.

    Thanks, again!

    Siamanti

  9. #9
    Follow: @AlexDawsonUK silver trophybronze trophy AlexDawson's Avatar
    Join Date
    Feb 2009
    Location
    England, UK
    Posts
    8,111
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)
    A simple method would be to have the action attribute on your form element direct to a PHP page (which handles the script) - this will have the submit button send the data to there... as for a very simple PHP script, the following would do the trick, just make sure your form elements have an ID of email, subject, and message (for each thing - you can add more to the script and PHP file if you need them), it's very rudimentary but it'll do the job.
    Code PHP:
    <?php
    $mail_To = "Support@yoursite.com"
    $mail_From = $_POST['email'];
    $mail_Subject = $_POST['subject'];
    $mail_Body = $_POST['message'];
    mail($mail_To, $mail_Subject, $mail_Body, $mail_From);
    header("Location: http://www.yoursite.com/");
    exit;
    ?>

  10. #10
    SitePoint Member
    Join Date
    Nov 2009
    Posts
    24
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks very much. I will give this a try

  11. #11
    SitePoint Member
    Join Date
    Nov 2009
    Posts
    24
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have coded the php file and the message arrived at the recipient but it just shows contact us and the actual message content does not arrive. I am sure that I am doing something wring with the order of my code in correspondence to my form code I will post the code underneath for the php file and the form.
    Any help very much appreciated as I am beginning to feel to stupid.

    form method="post" action="sendmail.php">
    <?php
    $to = "totraining@aol.com";
    $email = $_REQUEST['email'] ;
    $headers = "From: $email";
    $subject = "Contact Us";
    $message = $_REQUEST['message'] ;

    $sent = mail($to, $headers, $subject, $message) ;
    if($sent)
    {print "Your mail was sent successfully"; }
    else
    {print "We encountered an error sending your mail"; }

    $message = " $todayis [EST] \n
    Attention: $attn \n
    Message: $notes \n
    From: $visitor ($visitormail)\n
    Additional Info : IP = $ip \n
    Browser Info: $httpagent \n
    Referral : $httpref \n
    ";
    ?>

  12. #12
    SitePoint Member
    Join Date
    Nov 2009
    Posts
    24
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This is the code for my form:

    <!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>Contact form</title>
    <link href="css/style_inside.css" rel="stylesheet" type="text/css" />
    </head>
    <body style="margin:0; padding:0">
    <h1 class="contact-title">Nachrichten senden/h1>
    <form action="send.php" method="post" class="formm">
    <table align="left">
    <tbody>
    <tr class="mar">
    <th class="lable">*Name/th>
    <td class="input"><input name="name" size="40" maxlength="40" class="input" type="text"></td>
    </tr>
    <tr>
    <th class="lable">*E-mail/th>
    <td class="input"><input name="email" size="40" maxlength="40" class="input" type="text"></td>
    </tr>
    <tr>
    <th class="lable">Subject/th>
    <td class="input"><input name="subject" size="40" maxlength="40" class="input" type="text"></td>
    </tr>
    <tr>
    <th class="lable">*Nachricht/th>
    <td class="input"><textarea name="text_message" cols="40" rows="10" class="input"></textarea></td>
    </tr>
    <br />
    <br />
    <br />
    <tr>
    <th></th>
    <td align="center"><input name="mail_submit" type="submit" value="Nachricht senden">
    </td>
    </tr>
    </tbody>
    </table>
    </form>

    </body>
    </html>

  13. #13
    Follow: @AlexDawsonUK silver trophybronze trophy AlexDawson's Avatar
    Join Date
    Feb 2009
    Location
    England, UK
    Posts
    8,111
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)
    Well the name of the textbox for the message is text_message and you have message request pointing nowhere... $message = $_REQUEST['message'] ;

    You should either rename text_message to message, or have the request value renamed to text_message.

    Using text_message as the name of the textbox, this would work: $message = $_REQUEST['text_message'] ;


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
  •