hi i'm currently sending multi email recipients in one go is it possible to send it individually? please help thank you. - <?php
-
require_once 'library/config.php';
-
?>
-
-
<?php
-
-
$qe = "SELECT `cust_id`, `cust_name`, `cust_email`, `cust_phone`, `cust_address`, `cust_city`, `cust_state`, `cust_country`, `cust_pin`, `cust_spec_note` FROM `sland_pizza_customer` WHERE 1";
-
$re = dbQuery($qe);
-
if(dbNumRows($re)>0)
-
{
-
while($ra = dbFetchAssoc($re)):
-
$cust_email .=$ra['cust_email'].","." ";
-
endwhile;
-
}
-
-
-
-
$to = $cust_email; // sender
-
$subject = 'Get 5% Discount Every Order';
-
-
// To send HTML mail, the Content-type header must be set
-
$headers = 'MIME-Version: 1.0' . "\r\n";
-
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
-
$headers .= 'From: yoursite Penrith<newsletter@yoursite.com.au>' . "\r\n";
-
-
// Put your HTML here
-
$message = file_get_contents('marketing.html');
-
-
// Mail it
-
mail($to, $subject, $message, $headers);
-
echo "It's Sent";
-
?>
10 4043
Please use code tags when posting code or formatted data.
Instead of appending all the email addresses together, move the mail stuff into your loop.
Please show the new code.
its same as the above code, it does not sends them one by one! it sends them all together, i want to send them one by one. thanks Rabbit
You said "that did not fix my problems". The implication is that you made the code changes I suggested. But then you said there is no new code. Which means you didn't make the code changes I suggested.
You need to make the changes I suggested in my first post then post the new code if you are still having issues.
here is the updated code, it says "It's Sent" but i dont see any emails coming thank you Rabbit - <?php
-
require_once 'library/config.php';
-
-
-
$qe = "SELECT `cust_id`, `cust_name`, `cust_email`, `cust_phone`, `cust_address`, `cust_city`, `cust_state`, `cust_country`, `cust_pin`, `cust_spec_note` FROM `sland_pizza_customer` WHERE 1";
-
$re = dbQuery($qe);
-
if(dbNumRows($re)>0)
-
{
-
-
-
$num=dbNumRows($re);
-
-
-
while ($i < $num)
-
-
{
-
-
$cust_name='$row[cust_name]';
-
-
if($qe == TRUE)
-
-
{
-
-
-
$to ='$row[cust_email]'; // sender
-
$subject = 'Get 5% Discount Every Order';
-
-
// To send HTML mail, the Content-type header must be set
-
$headers = 'MIME-Version: 1.0' . "\r\n";
-
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
-
$headers .= 'From: yoursite Penrith<newsletter@yoursite.com.au>' . "\r\n";
-
-
// Put your HTML here
-
$message = file_get_contents('marketing.html');
-
-
// Mail it
-
mail($to, $subject, $message, $headers);
-
echo "It's Sent";
-
-
-
$i++;
-
-
}
-
-
}
-
}
-
-
?>
Why did you change your loop condition?
what you suggest me to do, can you give me some code that i can just copy and paste thank you Rabbit
This isn't a code writing service, we are here to help you learn what you did wrong so you can learn to be self sufficient.
What I am suggesting you do is to change your loop condition back to what it was. The only changes I suggested was to stop appending the addresses and to move the code around. You made way more changes than I suggested. Start with your original code again and only make the changes I originally suggested.
looks like i did waste my time, im just gonna keep trying till i get it done. thanks anyway
Sign in to post your reply or Sign up for a free account.
Similar topics
by: James Hong |
last post by:
Help please, I try to sending an email from my html page using the java
applet.
but it give error on most of the PC only very few work, what is the error i
make
the java applet show as below
...
|
by: dccarson |
last post by:
Here is a snippet of code which does not send to all recipients.
However, it also does not inform me of this error. My suspicion is
that this only fails for users with longer usernames. The two I...
|
by: news.microsoft.com |
last post by:
HI,
ASPEmail to send to multiple recipients?
I tried to use comma and semicolon but all the time give this message
error:
Error: 6 - 501 Bad address syntax
nor :...
|
by: .Net Newbie |
last post by:
Hello,
I am currently coding my ASP.Net pages in c# and have run into a question
concerning Emails. I have four objects on a page (six including 2 buttons).
The first is a subject line...
|
by: Michelle |
last post by:
Hi
Is it possible/anyone know how to send a document (.pdf) to multiple
recipients using POP where the email is not just a matter of throwing 1000
email addresses in the BCC list, but each email...
|
by: Mr T |
last post by:
I know how to send email from Access and I know how to create a custom
form in Outlook. but.... How do I put the email info from Access into
the Outlook custom form ???
Dim MyDB As Database
Dim...
|
by: Lazareth |
last post by:
Hi,
I am trying to write a program to send email messages to selected recipients on a form when a button is clicked (each recipient has a checkbox) .
The recipient section I can work out, but I...
|
by: shahnawaz shaikh |
last post by:
hi
friends
i want to send email thoruth stored procedure or i want to give functionality like alert which is send email automaticaly from database.
just like a news or any ad email weekly or...
|
by: cpanelxp |
last post by:
hi,
I have programmed a software that can send email to one recipient with this code
In General Declaration I used this code
Imports System.Net.Mail
In Form Declaration I used this code
|
by: Wnicole |
last post by:
I was hoping someone can look at this code and tell me what is missing
It works all the way to outlook but once there it is not linking with the emails from the query on the report. It's sending the...
|
by: DolphinDB |
last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation.
Take...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
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...
|
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...
|
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...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
|
by: Defcon1945 |
last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
|
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....
|
by: af34tf |
last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
| |