mail() problem

This is a discussion on "mail() problem" within the PHP Forum section. This forum, and the thread "mail() problem are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > PHP Forum

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old May 10th, 2006, 16:44
New Member
Join Date: Jan 2006
Age: 30
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
mail() problem

I've tried using mail() on it's own and it only sends the mail once but in this script it sends it out twice. Could it be something to do with headers or sessions? I'm calling this script by:

PHP: Select all

header("location: registerc.php"); 

registerc.php:

PHP: Select all

<? session_start();
include(
"connect.php");
$p_result mysql_query("SELECT * FROM personal_details WHERE userid='$user'");
$p_row mysql_fetch_row($p_result);
$l_result mysql_query("SELECT * FROM login WHERE userid='$user'");
$l_row mysql_fetch_row($l_result);
include(
"header.php");
include(
"tab3.php");
$nav_title="Open An Account";
include(
"navbar.php");
?>
<div class="progressbar">
  <div style="float:left; margin-right:20px;">1. Enter Information</div>
  <div style="float:left; margin-right:20px;"><b>2. Verify Information</b></div>
  <div style="float:left; margin-right:20px;">3. Check Email</div>
</div>
<div class="content">
  <h1>Verify Information</h1>
  <div class="divider"></div>
  <?
  $body  
"Hello $p_row[1] $p_row[2], \n\n";
  
$body .= "Click the link below to activate your Auction.Beta account: \n\n";
  
$body .= "http://www.argyllnewmedia.co.uk/auction/validate.php?u=$l_row[0]&v=$l_row[3] \n\n";
  
$body .= "If you're unable to click the link above, cut and paste it into your web browser. \n\n";
  
$body .= "Should you forget your password, you can request a new one which will be sent to this email address. \n\n";
  
$body .= "Thank you for registering. \n\n\n";
  
$body .= "Auction.Beta Team \n\n";
  
$from "registration@auction.co.uk";
  
$mailheader "From: $from\r\n";
  
mail("$l_row[2]","Auction.Beta Registration","$body","$mailheader");
  echo 
"We just sent an email to <b>$l_row[2]</b> to verify your registration. It contains a link you'll need to 
  follow to confirm your email address. Please check your email now.<br><br>"
;
  
?>
  <p>If you do not receive the message in the next 10 minutes, you can <b>
  <a class="bluelink" href="registerc.php">request another verification email.</a></b></p>
  <p>If you've been waiting for over 15 minutes:
  <ol>
  <li>Make sure you have entered the correct email address</li>
  <li>Make sure your spam filter allows email from "registration@auction.beta"</li>
  <li>Request the verification email again</li>
  </ol></p>
  <p>For your records, here are your account details:</p>
  <div class="inner_content">
    <div class="mailing"><b>Address</b><br><? echo "$p_row[1] $p_row[2]"?></div>
    <div class="mailing"><? echo $p_row[3]; ?></div>
    <div class="mailing"><? echo $p_row[4]; ?></div>
    <div class="mailing"><? echo $p_row[5]; ?></div>
    <div class="mailing"><? echo $p_row[6]; ?></div>
    <div class="mailing"><? echo $p_row[7]; ?></div>
    <div class="mailing"><br><b>User Name</b><br><? echo $l_row[0]; ?></div>
    <div class="mailing"><br><b>Password</b><br><? echo $l_row[1]; ?></div> 
    <div class="mailing"><br><b>Sectret Question</b><br><? echo $l_row[4]; ?></div>     
    <div class="mailing"><br><b>Sectret Answer</b><br><? echo $l_row[5]; ?></div>
  </div>
</div>
<? include("footer.php"); ?>
Reply With Quote

  #2 (permalink)  
Old May 10th, 2006, 17:06
Most Reputable Member
Join Date: Aug 2005
Location: North Wales, United Kingdom
Age: 21
Posts: 1,093
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to sypher
Re: mail() problem

Be sure to put LIMIT 1 on your mysql querys
Reply With Quote
  #3 (permalink)  
Old May 10th, 2006, 17:13
New Member
Join Date: Jan 2006
Age: 30
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Re: mail() problem

Good idea but there is only one entry in the DB. I think it is a header problem.
Reply With Quote
  #4 (permalink)  
Old May 10th, 2006, 17:21
Most Reputable Member
Join Date: Aug 2005
Location: North Wales, United Kingdom
Age: 21
Posts: 1,093
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to sypher
Re: mail() problem

Try adding
PHP: Select all

<?php ob_start();

at the beginning of the page (before any sessions or header info.

&
PHP: Select all

ob_end_flush(); 

at the very end of the page after all the code.
Reply With Quote
  #5 (permalink)  
Old May 10th, 2006, 21:22
Most Reputable Member
Join Date: Apr 2006
Location: Cornwall, UK
Posts: 1,310
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Skype™ to ukgeoff
Re: mail() problem

Can we see the raw header info from within the two emails that are sent.

You might need to do it via PM so as to protect the actual email addresses.
Reply With Quote
Reply

Tags
mail, problem

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP Mail Form Synoptic PHP Forum 2 Jun 11th, 2008 21:16
e-mail screen problem kool77 PHP Forum 3 May 29th, 2007 08:44
problem with images when sending html page by mail juanb007 Web Page Design 4 Apr 29th, 2007 03:25
Problem with lycos mail in netscape 8.1 nitu Introduce Yourself 2 Sep 12th, 2006 18:16
visitors name not displayed in mail after filling in mail form made on earth PHP Forum 7 Nov 16th, 2005 22:43


All times are GMT. The time now is 05:46.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43