473,322 Members | 1,714 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Mailer script sends email twice

11
Hello Sir/ Madam,
I solve my problem. I can't end loop in this script. I receive two time mail. I wanna receive only one time mail.

Expand|Select|Wrap|Line Numbers
  1.  <?php  
  2.             $txtName=$_REQUEST['txtName'];
  3.             $txtEmail=$_REQUEST['txtEmail'];
  4.             $txtCompany=$_REQUEST['txtCompany'];
  5.             $txtPhone=$_REQUEST['txtPhone'];
  6.             $txtSubject=$_REQUEST['txtSubject'];
  7.             $txtDetail=$_REQUEST['txtDetail'];
  8.  
  9.             $to = "your_name@gmail.com";
  10.             $headers = "From:" . $txtEmail . "\r\n";
  11.             $headers .= "Reply-To:" . $txtEmail . "\r\n";
  12.             $headers .= "Return-Path:" . $txtEmail . "\r\n";
  13.             $headers .= "CC: your_name@rediffmail.com\r\n";
  14.             $headers .= "BCC: your_name@yahoo.co.in\r\n";
  15.             if (empty($txtDetail))
  16.             {
  17.                 echo("Please" . "<a href=http://www.xyz.com > Click here" . " to contact us.");
  18.             }
  19.             else
  20.             {
  21.                 $message = "Email sender - " . $txtName ;
  22.                 $message .= "\r\n From Company -" . $txtCompany;
  23.                 $message .= "\r\n Contact Phone -" . $txtPhone;
  24.                 $message .= "\r\n Message -" . $txtDetail;
  25.                 if (mail($to,$txtSubject,$message,$headers) ) 
  26.                 {
  27.                     $result= "Email has been sent to the customer service! We will respond to you promptly.";
  28.  
  29.                 } 
  30.                 else 
  31.                 {
  32.                     $result="There was problems sending out the email! Please click" . "<a href=mailto:your_name@gmail.com> Here to contact us";
  33.                 }
  34.             }
  35.         ?>
Thanks
Kalaram

Email addresses removed: for your own safety do not post the email in the technical forums-ajaxrand
Sep 5 '07 #1
5 2965
ak1dnar
1,584 Expert 1GB
Hi Welcome to TheScripts.com

You have posted this thread in the Php-Articles section , So I had to move it back to the Forum. Please use the Php-Forum for posting questions in future. Thanks !
Sep 5 '07 #2
nathj
938 Expert 512MB
Hello Sir/ Madam,
I solve my problem. I can't end loop in this script. I receive two time mail. I wanna receive only one time mail.

Expand|Select|Wrap|Line Numbers
  1.  <?php  
  2.             $txtName=$_REQUEST['txtName'];
  3.             $txtEmail=$_REQUEST['txtEmail'];
  4.             $txtCompany=$_REQUEST['txtCompany'];
  5.             $txtPhone=$_REQUEST['txtPhone'];
  6.             $txtSubject=$_REQUEST['txtSubject'];
  7.             $txtDetail=$_REQUEST['txtDetail'];
  8.  
  9.             $to = "your_name@gmail.com";
  10.             $headers = "From:" . $txtEmail . "\r\n";
  11.             $headers .= "Reply-To:" . $txtEmail . "\r\n";
  12.             $headers .= "Return-Path:" . $txtEmail . "\r\n";
  13.             $headers .= "CC: your_name@rediffmail.com\r\n";
  14.             $headers .= "BCC: your_name@yahoo.co.in\r\n";
  15.             if (empty($txtDetail))
  16.             {
  17.                 echo("Please" . "<a href=http://www.xyz.com > Click here" . " to contact us.");
  18.             }
  19.             else
  20.             {
  21.                 $message = "Email sender - " . $txtName ;
  22.                 $message .= "\r\n From Company -" . $txtCompany;
  23.                 $message .= "\r\n Contact Phone -" . $txtPhone;
  24.                 $message .= "\r\n Message -" . $txtDetail;
  25.                 if (mail($to,$txtSubject,$message,$headers) ) 
  26.                 {
  27.                     $result= "Email has been sent to the customer service! We will respond to you promptly.";
  28.  
  29.                 } 
  30.                 else 
  31.                 {
  32.                     $result="There was problems sending out the email! Please click" . "<a href=mailto:your_name@gmail.com> Here to contact us";
  33.                 }
  34.             }
  35.         ?>
Thanks
Kalaram

Hi Kalaram,

I don't see any loop in this code. Could it be that you were receiving the email twice becaus e your email address was listed twice? It's just a shot in the dark.

Cheers
nathj
Sep 5 '07 #3
pbmods
5,821 Expert 4TB
Changed thread title to better describe the problem (did you know that threads whose titles do not follow the Posting Guidelines actually get FEWER responses?).
Sep 5 '07 #4
Kalaram
11
Hello Sir/ Madam,
I can't see email address list twice. plz u mark that place where i write twice mail address. Send me ASAP.

Thanks
Kalaram


Hi Kalaram,

I don't see any loop in this code. Could it be that you were receiving the email twice becaus e your email address was listed twice? It's just a shot in the dark.

Cheers
nathj
Sep 11 '07 #5
ak1dnar
1,584 Expert 1GB
Remove the CC: and BCC: addresses from your mail script. who knows Is there any mail forwarder enabled on your mail clients, which sends the CC or BCC headers back to your TO header.
Sep 11 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Raphael Gluck | last post by:
Hi all I am still finding my feet creating a website in ASP, and i'm trying to get to grips with users providing feeback to my site. my webhosts have the dundas mailer installed, and i am trying...
5
by: WoG | last post by:
I am having a heck of a problem getting this script to email correctly. A form generates all the values, and the script sends off confirmation email- except I don't get any of the confirmation...
8
by: Dave Smithz | last post by:
Hi, Thanks to this group I discovered the excellent PHP Mailer (http://phpmailer.sourceforge.net/) which I use to send emails. Part of my application emails out hundreds of club members unique...
7
by: Paul Marshall | last post by:
Hi I am my wits end! I have a PHP script running that captures variables posted from a form on the previous page. The script then emails the results using the mail() function. The script is...
10
by: Flopper | last post by:
Hey can anyone help me with a WORKING anonymous mailer php script. I've looked on the net but only find non working one's. Greetings Floppie
4
by: =?Utf-8?B?TWlrZSBI?= | last post by:
I'm using a block of ASP to allow a user to send a form via e-mail. However, someone keeps sending me spam through this form and they're using a bogus return address. I'm testing for a successful...
2
by: kind1one | last post by:
I am green to PHP and trying to create outside PHP mailer for html form ,i found the script i need but I can't get it to upload more than one file ,since i do not know exactly where to place script...
6
by: Dave Kelly | last post by:
Sorry for the long post, it is easier to discard information than to have to wait for it to arrive. So here goes: This code worked perfectly when I was an Earthlink customer. Sprint decided...
9
by: neovantage | last post by:
hey geeks, I have a small mail script which will cause a PHP script to send a receipt upon clicking the submit button, by an HTML mail. This mail contains special characters, namely 'å', 'ä' and...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.