473,811 Members | 3,610 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Getting 3 emails from one mail()

Wm
I'm totally clueless on this one -- I'm getting 3 copies of every Email (in
plain text, not HTML as expected), from a single mail() line... Can anyone
tell me what might be causing the duplicates??

Thanx!
Wm
<?PHP
include('dbconn .php');
$query="SELECT
artistID,active ,email,firstnam e,lastname,city ,state,mentor from artists
WHERE artistID='$arti stID'";
$result=mysql_q uery($query) or die(mysql_error ("Could not execute
query."));
while($row = mysql_fetch_arr ay($result)) {
$email = $row['email'];
$notactive = $row['active'];
$firstname = $row['firstname'];
$lastname = $row['lastname'];
$city = $row['city'];
$state = $row['state'];
$mentor = $row['mentor'];

if ($mentor == "1") {
$class = "as a Mentor";
}
else {
$class = "as an Assistant";
}

if (($notactive == "0") AND ($ver == "1")) {
mysql_query("UP DATE artists SET active='1' WHERE artistID =
'$artistID' LIMIT 1");
echo "Your listing has been successfully activated -- welcome to
Makeup Mentors!<BR>
Please tell a friend about this resource!";
// generate Email
$headers = "From: domain.com <We*******@doma in.com>\n";
$headers .= "X-Sender: <We*******@doma in.com>\n";
$headers .= "X-Mailer: domain.com\n"; //mailer
$headers .= "X-MSMail-Priority: Normal\n";
$headers .= "X-Priority: 3\n"; //1 UrgentMessage, 3 Normal
$headers .= "Return-Path: <We*******@doma in.com>\n";
$headers .= "bcc: ma**@herdomain. com";
$headers .= "Content-Type: text/html; charset=iso-8859-1\n";
$city = stripslashes($c ity);
$message = "
<p align=\"left\"> domain.com has just activated the following artist
$class:</p>
<p align=\"left\"> Name: $firstname $lastname<br>
Location: $city, $state</p>
<p>&nbsp;</p>
<p align=\"left\"> Webmaster<br>
<A HREF=\"http://www.domain.com\ ">www.domain.co m</A></p>";
$subject = "Makeup Mentors listing verification";
$to = "wi*****@mydoma in.net";
mail($to, $subject, $message, $headers);
}
else if (($active > 0) AND ($ver == "1")) {
echo "Your listing is already activated.<BR>" ;
}
}
?>
Jul 16 '05 #1
6 2501

"Wm" <LA*******@hotm ail.com> schreef in bericht
news:nV******** **************@ news.easynews.c om...
I'm totally clueless on this one -- I'm getting 3 copies of every Email (in plain text, not HTML as expected), from a single mail() line... Can anyone
tell me what might be causing the duplicates??

Thanx!
Wm

Hmm I dont have the time to figure out the { {{{{ }}}}} part .... maybe u
should try some structure.
did u try a echo msql_num_rows($ result); ? maybe u will find ur getting 3
results for some odd reason. Did u set primary key unique ?

Cya

Floortje
Jul 16 '05 #2
Wm
"floortje" <fl******@floor tje.floortje> wrote in message
news:3f******** *************** @dreader8.news. xs4all.nl...
"Wm" <LA*******@hotm ail.com> schreef in bericht
news:nV******** **************@ news.easynews.c om...
I'm totally clueless on this one -- I'm getting 3 copies of every Email (in plain text, not HTML as expected), from a single mail() line... Can anyone tell me what might be causing the duplicates??

Hmm I dont have the time to figure out the { {{{{ }}}}} part .... maybe u
should try some structure.
did u try a echo msql_num_rows($ result); ? maybe u will find ur getting 3
results for some odd reason. Did u set primary key unique ?

Cya

Floortje


Yes, I have an autonumber field as a primary key. Every single registrant is
generating exactly 3 emails so I know that it's not duplicate records, it
must be something about my code that is looping...??

Wm
Jul 16 '05 #3

"Wm" <LA*******@hotm ail.com> schreef in bericht
news:ri******** ************@ne ws.easynews.com ...
"floortje" <fl******@floor tje.floortje> wrote in message
news:3f******** *************** @dreader8.news. xs4all.nl...
"Wm" <LA*******@hotm ail.com> schreef in bericht
news:nV******** **************@ news.easynews.c om...
I'm totally clueless on this one -- I'm getting 3 copies of every
Email
(in plain text, not HTML as expected), from a single mail() line... Can anyone tell me what might be causing the duplicates??
Hmm I dont have the time to figure out the { {{{{ }}}}} part .... maybe u should try some structure.
did u try a echo msql_num_rows($ result); ? maybe u will find ur getting 3 results for some odd reason. Did u set primary key unique ?

Cya

Floortje


Yes, I have an autonumber field as a primary key. Every single registrant

is generating exactly 3 emails so I know that it's not duplicate records, it
must be something about my code that is looping...??

Did u try msql_num_rows($ result); ?? U could try print_r($result ); ... that
will give ya more info on the content of the array
Jul 16 '05 #4
On Thu, 28 Aug 2003 15:13:51 +0200
"floortje" <fl******@floor tje.floortje> wrote:

<snip>
generating exactly 3 emails so I know that it's not duplicate
records, it must be something about my code that is looping...??

Did u try msql_num_rows($ result); ?? U could try print_r($result ); ...
that will give ya more info on the content of the array

Do you mean print_r($row) ? $result is not an array, its an integer.
Matt
--
Quispiam Power Computing | "There are two major products that come out
Pendle Hill, Australia | of Berkeley: LSD and UNIX. We don't believe
+61 2 9688 2894 | this to be a coincidence. "
www.quispiam.com | - Jeremy S. Anderson
Jul 16 '05 #5
Just wondering: why even have a while() if you only expect one result?

--
// DvDmanDT
MSN: dv******@hotmai l.com
Mail: dv******@telia. com
"kicksy" <sl********@blu eyonder.co.ukNO SPAM> skrev i meddelandet
news:Y4******** *************@n ews-text.cableinet. net...

"Wm" <LA*******@hotm ail.com> wrote in message
news:nV******** **************@ news.easynews.c om...
I'm totally clueless on this one -- I'm getting 3 copies of every Email

(in
plain text, not HTML as expected), from a single mail() line... Can anyone tell me what might be causing the duplicates??

Thanx!
Wm
<?PHP
include('dbconn .php');
$query="SELECT
artistID,active ,email,firstnam e,lastname,city ,state,mentor from artists
WHERE artistID='$arti stID'";
$result=mysql_q uery($query) or die(mysql_error ("Could not execute
query."));


I'm gonna suggest doing this.
$row=mysql_fetc h_array($result );
if (mysql_num_rows ($row)==1)//1 result returned
{
// while loop
}
else
{
echo "too many results returned";
}

This way you can see if you are getting too many...
:P
while($row = mysql_fetch_arr ay($result)) {
$email = $row['email'];
$notactive = $row['active'];
$firstname = $row['firstname'];
$lastname = $row['lastname'];
$city = $row['city'];
$state = $row['state'];
$mentor = $row['mentor'];

if ($mentor == "1") {
$class = "as a Mentor";
}
else {
$class = "as an Assistant";
}

if (($notactive == "0") AND ($ver == "1")) {
mysql_query("UP DATE artists SET active='1' WHERE artistID =
'$artistID' LIMIT 1");
echo "Your listing has been successfully activated -- welcome to Makeup Mentors!<BR>
Please tell a friend about this resource!";
// generate Email
$headers = "From: domain.com <We*******@doma in.com>\n";
$headers .= "X-Sender: <We*******@doma in.com>\n";
$headers .= "X-Mailer: domain.com\n"; //mailer
$headers .= "X-MSMail-Priority: Normal\n";
$headers .= "X-Priority: 3\n"; //1 UrgentMessage, 3 Normal
$headers .= "Return-Path: <We*******@doma in.com>\n";
$headers .= "bcc: ma**@herdomain. com";
$headers .= "Content-Type: text/html; charset=iso-8859-1\n";
$city = stripslashes($c ity);
$message = "
<p align=\"left\"> domain.com has just activated the following artist $class:</p>
<p align=\"left\"> Name: $firstname $lastname<br>
Location: $city, $state</p>
<p>&nbsp;</p>
<p align=\"left\"> Webmaster<br>
<A HREF=\"http://www.domain.com\ ">www.domain.co m</A></p>";
$subject = "Makeup Mentors listing verification";
$to = "wi*****@mydoma in.net";
mail($to, $subject, $message, $headers);
}
else if (($active > 0) AND ($ver == "1")) {
echo "Your listing is already activated.<BR>" ;
}
}
?>


Jul 16 '05 #6
Wm
"DvDmanDT" <dv******@telia .com> wrote in message
news:zz******** ***********@new sc.telia.net...
Just wondering: why even have a while() if you only expect one result?

--
// DvDmanDT
MSN: dv******@hotmai l.com
Mail: dv******@telia. com
"kicksy" <sl********@blu eyonder.co.ukNO SPAM> skrev i meddelandet
news:Y4******** *************@n ews-text.cableinet. net...

Good question! That's the way I've done other queries, so I copied the lines
that worked on other pages. I still get confused on all the options for
fetch_array, etc...

BTW, I'm still getting 1 result from the query, yet consistently receiving 3
emails...

Wm
"Wm" <LA*******@hotm ail.com> wrote in message
news:nV******** **************@ news.easynews.c om...
I'm totally clueless on this one -- I'm getting 3 copies of every Email
(in
plain text, not HTML as expected), from a single mail() line... Can
anyone tell me what might be causing the duplicates??

Thanx!
Wm
<?PHP
include('dbconn .php');
$query="SELECT
artistID,active ,email,firstnam e,lastname,city ,state,mentor from
artists WHERE artistID='$arti stID'";
$result=mysql_q uery($query) or die(mysql_error ("Could not execute
query."));


I'm gonna suggest doing this.
$row=mysql_fetc h_array($result );
if (mysql_num_rows ($row)==1)//1 result returned
{
// while loop
}
else
{
echo "too many results returned";
}

This way you can see if you are getting too many...
:P
while($row = mysql_fetch_arr ay($result)) {
$email = $row['email'];
$notactive = $row['active'];
$firstname = $row['firstname'];
$lastname = $row['lastname'];
$city = $row['city'];
$state = $row['state'];
$mentor = $row['mentor'];

if ($mentor == "1") {
$class = "as a Mentor";
}
else {
$class = "as an Assistant";
}

if (($notactive == "0") AND ($ver == "1")) {
mysql_query("UP DATE artists SET active='1' WHERE artistID =
'$artistID' LIMIT 1");
echo "Your listing has been successfully activated -- welcome to Makeup Mentors!<BR>
Please tell a friend about this resource!";
// generate Email
$headers = "From: domain.com <We*******@doma in.com>\n";
$headers .= "X-Sender: <We*******@doma in.com>\n";
$headers .= "X-Mailer: domain.com\n"; //mailer
$headers .= "X-MSMail-Priority: Normal\n";
$headers .= "X-Priority: 3\n"; //1 UrgentMessage, 3 Normal
$headers .= "Return-Path: <We*******@doma in.com>\n";
$headers .= "bcc: ma**@herdomain. com";
$headers .= "Content-Type: text/html;
charset=iso-8859-1\n"; $city = stripslashes($c ity);
$message = "
<p align=\"left\"> domain.com has just activated the following

artist $class:</p>
<p align=\"left\"> Name: $firstname $lastname<br>
Location: $city, $state</p>
<p>&nbsp;</p>
<p align=\"left\"> Webmaster<br>
<A HREF=\"http://www.domain.com\ ">www.domain.co m</A></p>";
$subject = "Makeup Mentors listing verification";
$to = "wi*****@mydoma in.net";
mail($to, $subject, $message, $headers);
}
else if (($active > 0) AND ($ver == "1")) {
echo "Your listing is already activated.<BR>" ;
}
}
?>



Jul 16 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2896
by: dan glenn | last post by:
I'm creating HTML emails from a PHP site and sending them out to an email list (just about 40 people so far are on this list). I've tested and confirmed that these emails work in yahoo.com's webmail. And I know they work on *my* Outlook Express. But I have one person (I know of) who gets the emails as plain text, so she sees the HTML code for the email instead of its proper representation. She has, like myself, OE6, and other html emails...
40
11924
by: ian | last post by:
Hi, I'm a newbie (oh no I can here you say.... another one...) How can I get Python to send emails using the default windows email client (eg outlook express)? I thought I could just do the following import win32com.client
2
9246
by: Mr. x | last post by:
Hello, I am sending emails with Hebrew contents. When receiving emails - I cannot see the Hebrew characters (it is not outlook express configuration, because when receiving emails from friends - I see hebrew, it is just sending by myself using *.aspx scripts). In web.config I have the following : <configuration> <system.web>
2
1460
by: Joey | last post by:
I am currently developing a C# asp.net application where users are required to register. The application then generates a simple, plain text email and sends it to the new user. I have been trying to use the MailMessage and SmtpMail classes from the System.Web.Mail namespace (built in to .net) to do this. It is my understanding that these classes use CDONTS (cdosys.dll) and the SMTP mail service on the server to send the messages....
9
1768
by: Dave | last post by:
I searched the usenet and some mail archives and tried various techniques, but I can't seem to get the .NET 2.0 SDK to work with python. I'm a total newbie when it comes to python installs. I downloaded the .NET 2.0 SDK and I have python 2.4.2 and im trying to install zope. So i go to the cmd and go to the directory and type "python setup.py build" (Will have to install after) and it comes up with this(after everything else runs smoothly):...
21
2740
by: maya | last post by:
hi, I'm designing an HTML email for a client.. I know general guidelines (no CSS, no JavaScript... although I do use limited CSS, inside tags (as in <span style=".."we do this at work and it works fine, so I figured it's ok..) but I have a few more questions, for example, is it ok to do client-side image-maps? is there a web page somewhere with general guidelines for HTML e-mails? (and what is best way to test HTML e-mails? (I...
5
2453
by: Jai | last post by:
Hi, I am in a problem of sending mass emails(newsletter) to my website members. Actually my problem is this: I want to send newsletter to my website members. But I had given a facility for each member to choose different category of products or all products newsletter.
10
3032
by: crazycooter | last post by:
I found an old thread on this (http://groups.google.com/group/alt.php/ browse_thread/thread/751edb9c723316c4/ea9bf92a9c6b807c?lnk=gst&q=mail() +duplicate&rnum=7#ea9bf92a9c6b807c), but there didnt seem to be a resolution. I also noticed that this was a pretty old thread and there didn't seem to be anything newer in the search results. Regardless, I have a very similar problem; I am consistently getting five emails per each PHP mail()...
0
3441
by: =?Utf-8?B?Q2hhcmxlcw==?= | last post by:
Like many people, I normally use Yahoo! Mail via the web and like to keep all my emails stored on the Yahoo! server. However sometimes I can’t get access to a PC/the web and I download my emails to a PDA/palmtop via POP3. The PDA uses Windows Mobile software. Since using the PDA, I have had the problem of emails disappearing from the Yahoo! server. However I think I now understand how to avoid this. It seems that Windows Mobile is...
0
9604
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10379
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10394
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9201
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7665
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6882
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5552
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5690
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
3015
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.