Ask a Question related to PHP Development, Design and Development.
-
Wm #1
Getting 3 emails from one mail()
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,firstname,lastname,city,stat e,mentor from artists
WHERE artistID='$artistID'";
$result=mysql_query($query) or die(mysql_error("Could not execute
query."));
while($row = mysql_fetch_array($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("UPDATE 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 <Webmaster@domain.com>\n";
$headers .= "X-Sender: <Webmaster@domain.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: <Webmaster@domain.com>\n";
$headers .= "bcc: [email]mary@herdomain.com[/email]";
$headers .= "Content-Type: text/html; charset=iso-8859-1\n";
$city = stripslashes($city);
$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> </p>
<p align=\"left\">Webmaster<br>
<A HREF=\"http://www.domain.com\">www.domain.com</A></p>";
$subject = "Makeup Mentors listing verification";
$to = "william@mydomain.net";
mail($to, $subject, $message, $headers);
}
else if (($active > 0) AND ($ver == "1")) {
echo "Your listing is already activated.<BR>";
}
}
?>
Wm Guest
-
Print Multiple Mail App Emails as One PDF
I'm pretty late to the topic but am having the same issue like Keith. Using the latest Mail.app i need to compile roughly 1900 emails that are... -
Mail component to retrieve mail from Hotmail, Yahoo, gmail..etc?
I am not sure these web based mail support POP3 or IMAP4. Is there any mail component out there that can retrieve mail from these services? --... -
#25357 [Com]: Mail() function is loosing cahracters when sending mail
ID: 25357 Comment by: dj_canard at yahoo dot com Reported By: pjsmith at microtech dot co dot gg Status: Bogus... -
#25195 [NEW]: Warning: mail(): Could not execute mail delivery program ...
From: mhawkins at ukeu dot com Operating system: Solaris 8 PHP version: Irrelevant PHP Bug Type: Mail related Bug... -
Import Mail.app emails into MS Outlook
Hi all, Is it possible to import saved emails in Mail.app (OS X) into Microsoft Outlook? I know I can drag a mailbox from Mail onto the desktop,... -
floortje #2
Re: Getting 3 emails from one mail()
"Wm" <LAshooter@hotmail.com> schreef in bericht
news:nVd3b.3140344$mA4.430269@news.easynews.com...(in> I'm totally clueless on this one -- I'm getting 3 copies of every EmailHmm I dont have the time to figure out the { {{{{ }}}}} part .... maybe u> plain text, not HTML as expected), from a single mail() line... Can anyone
> tell me what might be causing the duplicates??
>
> Thanx!
> Wm
>
>
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
floortje Guest
-
Wm #3
Re: Getting 3 emails from one mail()
"floortje" <floortje@floortje.floortje> wrote in message
news:3f4db753$0$76465$e4fe514c@dreader8.news.xs4al l.nl...(in> "Wm" <LAshooter@hotmail.com> schreef in bericht
> news:nVd3b.3140344$mA4.430269@news.easynews.com...> > I'm totally clueless on this one -- I'm getting 3 copies of every Emailanyone> > plain text, not HTML as expected), from a single mail() line... CanYes, I have an autonumber field as a primary key. Every single registrant is> Hmm I dont have the time to figure out the { {{{{ }}}}} part .... maybe u> > tell me what might be causing the duplicates??
> >
> 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
generating exactly 3 emails so I know that it's not duplicate records, it
must be something about my code that is looping...??
Wm
Wm Guest
-
Matthew Vickers #4
Re: Getting 3 emails from one mail()
On Thu, 28 Aug 2003 15:13:51 +0200
"floortje" <floortje@floortje.floortje> wrote:
<snip>
> Did u try msql_num_rows($result); ?? U could try print_r($result); ...> > generating exactly 3 emails so I know that it's not duplicate
> > records, it must be something about my code that is looping...??
> >
> 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. "
[url]www.quispiam.com[/url] | - Jeremy S. Anderson
Matthew Vickers Guest
-
floortje #5
Re: Getting 3 emails from one mail()
"Wm" <LAshooter@hotmail.com> schreef in bericht
news:rim3b.32590$hf5.177492@news.easynews.com...> "floortje" <floortje@floortje.floortje> wrote in message
> news:3f4db753$0$76465$e4fe514c@dreader8.news.xs4al l.nl...> > "Wm" <LAshooter@hotmail.com> schreef in bericht
> > news:nVd3b.3140344$mA4.430269@news.easynews.com...> > > I'm totally clueless on this one -- I'm getting 3 copies of everyu> (in> anyone> > > plain text, not HTML as expected), from a single mail() line... Can> > Hmm I dont have the time to figure out the { {{{{ }}}}} part .... maybe> > > tell me what might be causing the duplicates??
> > >3> > should try some structure.
> > did u try a echo msql_num_rows($result); ? maybe u will find ur gettingis>> > 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 registrantDid u try msql_num_rows($result); ?? U could try print_r($result); ... that> generating exactly 3 emails so I know that it's not duplicate records, it
> must be something about my code that is looping...??
>
will give ya more info on the content of the array
floortje Guest
-
DvDmanDT #6
Re: Getting 3 emails from one mail()
Just wondering: why even have a while() if you only expect one result?
--
// DvDmanDT
MSN: [email]dvdmandt@hotmail.com[/email]
Mail: [email]dvdmandt@telia.com[/email]
"kicksy" <slapkicksy@blueyonder.co.ukNOSPAM> skrev i meddelandet
news:Y4n3b.6544$us2.61719595@news-text.cableinet.net...anyone>
> "Wm" <LAshooter@hotmail.com> wrote in message
> news:nVd3b.3140344$mA4.430269@news.easynews.com...> (in> > I'm totally clueless on this one -- I'm getting 3 copies of every Email> > plain text, not HTML as expected), from a single mail() line... Canto>> > tell me what might be causing the duplicates??
> >
> > Thanx!
> > Wm
> >
> >
> > <?PHP
> > include('dbconn.php');
> > $query="SELECT
> > artistID,active,email,firstname,lastname,city,stat e,mentor from artists
> > WHERE artistID='$artistID'";
> > $result=mysql_query($query) or die(mysql_error("Could not execute
> > query."));
> I'm gonna suggest doing this.
> $row=mysql_fetch_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_array($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("UPDATE artists SET active='1' WHERE artistID =
> > '$artistID' LIMIT 1");
> > echo "Your listing has been successfully activated -- welcomeartist> > Makeup Mentors!<BR>
> > Please tell a friend about this resource!";
> > // generate Email
> > $headers = "From: domain.com <Webmaster@domain.com>\n";
> > $headers .= "X-Sender: <Webmaster@domain.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: <Webmaster@domain.com>\n";
> > $headers .= "bcc: [email]mary@herdomain.com[/email]";
> > $headers .= "Content-Type: text/html; charset=iso-8859-1\n";
> > $city = stripslashes($city);
> > $message = "
> > <p align=\"left\">domain.com has just activated the following>> > $class:</p>
> > <p align=\"left\">Name: $firstname $lastname<br>
> > Location: $city, $state</p>
> > <p> </p>
> > <p align=\"left\">Webmaster<br>
> > <A HREF=\"http://www.domain.com\">www.domain.com</A></p>";
> > $subject = "Makeup Mentors listing verification";
> > $to = "william@mydomain.net";
> > mail($to, $subject, $message, $headers);
> > }
> > else if (($active > 0) AND ($ver == "1")) {
> > echo "Your listing is already activated.<BR>";
> > }
> > }
> > ?>
> >
> >
>
DvDmanDT Guest
-
Wm #7
Re: Getting 3 emails from one mail()
"DvDmanDT" <dvdmandt@telia.com> wrote in message
news:zz24b.26258$dP1.66398@newsc.telia.net...Good question! That's the way I've done other queries, so I copied the lines> Just wondering: why even have a while() if you only expect one result?
>
> --
> // DvDmanDT
> MSN: [email]dvdmandt@hotmail.com[/email]
> Mail: [email]dvdmandt@telia.com[/email]
> "kicksy" <slapkicksy@blueyonder.co.ukNOSPAM> skrev i meddelandet
> news:Y4n3b.6544$us2.61719595@news-text.cableinet.net...> >
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" <LAshooter@hotmail.com> wrote in message
> > news:nVd3b.3140344$mA4.430269@news.easynews.com...> > > I'm totally clueless on this one -- I'm getting 3 copies of everyartists> anyone> > (in> > > plain text, not HTML as expected), from a single mail() line... Can> > > tell me what might be causing the duplicates??
> > >
> > > Thanx!
> > > Wm
> > >
> > >
> > > <?PHP
> > > include('dbconn.php');
> > > $query="SELECT
> > > artistID,active,email,firstname,lastname,city,stat e,mentor fromwelcome> >> > > WHERE artistID='$artistID'";
> > > $result=mysql_query($query) or die(mysql_error("Could not execute
> > > query."));
> > I'm gonna suggest doing this.
> > $row=mysql_fetch_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_array($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("UPDATE artists SET active='1' WHERE artistID =
> > > '$artistID' LIMIT 1");
> > > echo "Your listing has been successfully activated --charset=iso-8859-1\n";> to> > > Makeup Mentors!<BR>
> > > Please tell a friend about this resource!";
> > > // generate Email
> > > $headers = "From: domain.com <Webmaster@domain.com>\n";
> > > $headers .= "X-Sender: <Webmaster@domain.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: <Webmaster@domain.com>\n";
> > > $headers .= "bcc: [email]mary@herdomain.com[/email]";
> > > $headers .= "Content-Type: text/html;> artist> > > $city = stripslashes($city);
> > > $message = "
> > > <p align=\"left\">domain.com has just activated the following>> >> > > $class:</p>
> > > <p align=\"left\">Name: $firstname $lastname<br>
> > > Location: $city, $state</p>
> > > <p> </p>
> > > <p align=\"left\">Webmaster<br>
> > > <A HREF=\"http://www.domain.com\">www.domain.com</A></p>";
> > > $subject = "Makeup Mentors listing verification";
> > > $to = "william@mydomain.net";
> > > mail($to, $subject, $message, $headers);
> > > }
> > > else if (($active > 0) AND ($ver == "1")) {
> > > echo "Your listing is already activated.<BR>";
> > > }
> > > }
> > > ?>
> > >
> > >
> >
>
Wm Guest



Reply With Quote

