Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > Beginning PHP
|
Beginning PHP Beginning-level PHP discussions. More advanced coders should post to the Pro PHP forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning PHP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 28th, 2006, 03:47 PM
Authorized User
 
Join Date: Aug 2006
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default Arghhhh my email isn't sending!

Hi guys

No doubt there is a simple solution to this, but i cant get my form to email the details properly. The code is as follows:

<?php
    @extract($_POST);
    $fn = stripslashes($fname);
    $sn = stripslashes($sname);
    $comp = stripslashes($company);
    $a1 = stripslashes($address1);
    $a2 = stripslashes($address2);
    $twn = stripslashes($town);
    $cty = stripslashes($county);
    $num = stripslashes($number);
    $em = stripslashes($email);
    $cmd = stripslashes($contactmethod);
    $coursedate = stripslashes($date);
    $coursename = stripslashes($course);
    $todayis = date("l, F j, Y, g:i a") ;

    $to = "[email protected]";
    $subject = "Open Course Enquiry";
    $from = "From: $em\r\n";

    $body = "Blah blah.";

    if (mail($to, $subject, $body, $from))
        {
      echo("<h1>Open Courses</h1>
    <p>Thank you for registering an interest in this course.</p>
    <p>Your details have been taken and one of our representatives will be in touch shortly.</p>");
     } else {
     echo("<p>Message delivery failed.</p>");
     }
    ?>

If anyone can see why this wouldnt send an email please reply. It doesnt give an error message, it says the email has been sent, but ive never recieved anything

Cheers in advance

 
Old December 6th, 2006, 02:34 AM
Authorized User
 
Join Date: Nov 2006
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to talk2leo
Default

remove first line keep simple approach
$fn = stripslashes($_POST[fname]);
keep each variable like this and make a message sring adding all these fields
using (.)DOT opeprator

if it works then try with ur approach.
if it dosent work reply me







Similar Threads
Thread Thread Starter Forum Replies Last Post
Sending EMAIL charleshua BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 16 September 3rd, 2008 12:27 AM
Sending email maitias C# 2005 2 February 17th, 2006 11:24 AM
sending email keyvanjan Classic ASP Components 1 May 9th, 2005 05:56 PM
email sending msrnivas .NET Web Services 6 June 26th, 2004 06:59 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.