Mail () Multiple Recipients

Jul 19, 2002

I'm new to PHP and trying to get my mail () function working. My problem is, when I try to send an email to multiple recipients, it sends the email only to the last email id in the list. This is the code what I wrote :
mail($ToName." <".$ToEmail.">", $ToSubject, $Message, "From: ".$FromName."
<".$FromEmail.">", "Bcc: ".$vbcc );

and the email sting that I pass through the vbcc is something like URL, URL, URL etc.
ie putting a comma between each mail ID. But what it does is sends the email only to the "to" email id and the last ID in the 'vbcc' list in this case ' ' Could anyone tell me what am I doing wrong and how should I correct it Another thing is, is there any way I can get a return mail for the emails to which my mail was not delivered, like a bounced mail.


Mail $to Multiple Recipients From Database Table?

Aug 23, 2009

<?php include("admin/db.php");
$recipients = "SELECT * FROM recipients ORDER BY id DESC";
$email_list = $db->query($recipients);
foreach($email_list as $row) {
echo $row['email'].",";
$to = "?";

Above I have a comma delimitated list of emails which I need to insert into the $to variable. How do I do this?

View 2 Replies View Related

Mail Function To Send To Multiple Recipients

Mar 15, 2007

I am wondering how do i send mail to mulitple recipients using the mail finction.

Here is what i have so far:

$myname = "Action Drafting - Contact Us";
$myemail = "";
$contactname = "Administrator";
$contactemail = "";

$headers .= "MIME-Version: 1.0
$headers .= "Content-type: text/html; charset=iso-8859-1
$headers .= "From: ".$myname." <".$myemail.">
$headers .= "To: ".$contactname." <".$contactemail.">
$headers .= "Reply-To: ".$myname." <$myreplyemail>
$headers .= "X-Priority: 1
$headers .= "X-MSMail-Priority: High
$headers .= "X-Mailer: Just My Server";

$subjectText="Action Drafting Contact Us";
$msgText = "dadadadada";

mail($toText, $subjectText, $msgText, $headers);

Do i have to make an array of emails then loop through or can i just add them to the headers and $toText?

View 5 Replies View Related

Mail To Multiple Recipients From Query Result

Jun 16, 2007

I was wondering if anyone knows if there is a way to mail to mulitple recipients that are derived from a query?

$query = mysql_query("SELECT email FROM users WHERE title = 'Project Manager'");
while ($row  =  mysql_fetch_array($query)){
$manager_email = "$row[email]";

$contactemail = $manager_email;
$headers .= "To: ".$contactemail."";

So how do you do this when there are more than one manager emails?

View 3 Replies View Related

Mail Function To Send To Multiple Recipients?

Mar 15, 2007

I am wondering how do i send mail to mulitple recipients using the mail finction.

Here is what i have so far:

Code: [Select] $myname = "Action Drafting - Contact Us";
$myemail = "";
$contactname = "Administrator";
$contactemail = "";
$headers .= "MIME-Version: 1.0
$headers .= "Content-type: text/html; charset=iso-8859-1


Do i have to make an array of emails then loop through or can i just add them to the headers and $toText?

View 5 Replies View Related

Send E-mail To Multiple Recipients From Database Query ?

Jul 12, 2010

I'm trying to send an e-mail to multiple e-mail address in my database. Here is my current code. It is only working when I specify a single e-mail address, however, I need to have them query my database and send the e-mail to each e-mail address. Where am I going wrong here?

function sendmail($cat, $user) {
require_once "Mail.php";
$elist = mysql_query("SELECT cEmail FROM tblUsers WHERE cAlerts = 'All' AND cEAlerts = 'Yes' AND cPreferences [code]....

View 6 Replies View Related

PHPmailer Multiple Recipients Error 'Could Not Instantiate Mail Function'

Feb 17, 2010

I have the following code with PHPmailer:

$tomailn[0] = '';
$tomailn[1] = '';
foreach($tomailn as $value)
$mail->AddAddress($value, '');

But I am getting the error 'Could not instantiate mail function'. If I remove an item from the array it works fine, but gives an error on when trying to add 2 or more addresses. Is there a different way to add multiple e-mail addresses?

View 6 Replies View Related

Send Mail To Mulitple Recipients Using The Mail Finction?

Oct 14, 2009

how can i sent mail to multiple mailaddresses at a time? you have any script abt this

View 2 Replies View Related

Sending Mail To Different Recipients?

Jun 8, 2009

I have a simple form where the user gets to pick who to send a message to. For the php part i have a switch statement that gets the recipient's number and should send mail to his email address accordingly.

It has not been sending any mail.

here is my PHP

$recipient = $_POST["to"];
switch ($recipient) {
$name = "Tom Burdi";


View 7 Replies View Related

Form Mail Hide Recipients?

Nov 17, 2009

I know this has been asked before but the two threads don't seem to give an answer I can use. I run a web site for a bridge club and need a form to send a message to all members with a file attachment.

But I do not want each recipient to get a complete list of all the other members' e mail addresses - some of them are quite private people. This must be possible (?) but all my fiddling with various scripts has come to nothing.

View 4 Replies View Related

Php Mail Function - Use Different Subject Based On The Recipients

Aug 11, 2007

I am wondering if there is a way to use different suject line for different recipients.

I am using PHP mail function to send out email which confirm account registration ....

View 1 Replies View Related

Form To Mail Recipients - Email To Admin Does Not Arrive?

May 26, 2009

i have a form that sends contact information to a db, then i have one confirmation email sent and one email sent to the admin.The db insert and the confirmation email work fine, however the email to admin doesnt ....well, arrive. Ive used

$query = "INSERT INTO ccctact (first, sur, email, tel, message) VALUES ('$firstname', '$surname', '$email', '$tel', '$message')";[code]....

The strange thing is, if i replace the admin email address to my domain (that is differant to the '', it works....Is there somthing wrong with my script, or do you think its an issue with the host?

View 1 Replies View Related

Send Mails With Mail() Hide Recipients Address?

Jan 17, 2011

I am trying to build a email messaging system for a classified site ( a la craigslist), so that users can email each other. emails of registered users are stored in a database. What I want is for the recipients email address to be hidden from the sender's . If I just use the mail() function and dynamically get the recipients email from the database, will this email be visible to the person sending the mail? if the recipients email is indeed hidden from the sender's when using mail() this way, then why does craigslist anonymize's email ? isn't it already anonymous? Edit: so the email won't be visible to the person filling the form. SO the question remains is why does craigslist anonymizes email addresses? and whether I should implement the same?

View 2 Replies View Related

Send An Email To Multiple Recipients

Jan 16, 2005

This is a Q about the mail() function in PHP I want to send an email to multiple recipients. As I understand it:

It is possible to send an email to multiple recipients with a single call to the mail() function. Here is an example. All you need to do is modify the recipient variable as follows: Code:

View 1 Replies View Related

Multiple Recipients Of Form Data

Sep 5, 2006

I want to have my form submission details sent to multiple email addresses.

To do this which one of these is correct?

$mailto = ',' ;


$mailto = '','' ;

if do I do it?

View 2 Replies View Related

Sending An Email To Multiple Recipients

Jun 30, 2011

// connect to db

View 1 Replies View Related

Email Multiple Recipients In Recordset?

Jul 17, 2010

I have a sql recordset based on a date criteria that is displayed in a repeat region on my page. How can I send a personalized email to each email address in the recordset? I am new to php and i understand that I have to put the mail() inside an array with a do..while loop? I read and read and read on this subject and I have tried to adapt many, many script samples but I can't get any of them to work. Perhaps give me a sample of the proper script?

My query is:
SELECT MemberID, email, tblMembers.ExpiryDate, tblMembers.FName, tblMembers.LName
FROM tblMembers
WHERE (tblMembers.ExpiryDate)<CURDATE()+30 And Active='Yes' And tblMembers.TypeID<5

View 3 Replies View Related

Contact Form With Multiple Recipients?

Sep 2, 2009

I am trying to build a contact form that can either be sent to 1 or 2 recipients. I would like it to give the user the option of checking either Inquiries about employment check box or the General Inquiries check box or checking both.For example if they check Inquiries about employment check box the form would submit to [URL]....and/or if they check the General Inquiries check box the form would submit to [URL]....

PHP Code:

View 3 Replies View Related

Mailing Form To Multiple Recipients

Jan 18, 2010

I currently have a mail form that sends to a single email address. Does anyone know how i can set it up so it sends out to more than one email address. The Form

Code: [Select]<form method="POST" action="mailer.php">
<input type="text" name="name" size="19"><br>
<input type="text" name="email" size="19"><br>
<textarea rows="9" name="message" cols="30">

View 2 Replies View Related

Sending Email To Multiple Recipients But Only One Will Appear In The TO Field?

Apr 25, 2010

Is it possible to send an email to multiple recipients, but on the receiving end, the recipient will only see his/her email address? If so how do I do this and could you point me to some references?

I know this can be done via a loop that sends to each recipient separately. But then I'll have to consider other things as well, such as 1) server's settings: number of emails allowed to be sent per hour 2) server's settings: number of seconds interval between sending emails 3) if i add a few seconds interval (for #2) between emails, id have to worry about maximum execution time per script, because my email sending script might take minutes, if the number of recipients is large

I also know I can do a cron job for this, but was just wondering if there was a way, really, to do what I outlined in the first paragraph.

View 3 Replies View Related

Send Email To Multiple Recipients In Mysql Db?

Nov 5, 2009

I would like to make an email form that would select all the emails from a MySQL db and then send that message to all addresses. I got this script but was unable to get it working.

//Connect to database
mysql_connect("localhost","user","password") or die(mysql_error());
mysql_select_db("db") or die(mysql_error());
$sql = "SELECT email FROM members";
$res = mysql_query($sql) or die(mysql_error());
while( $row = mysql_fetch_assoc($res) )


View 1 Replies View Related

Send A Personalised Email To Multiple Recipients?

Jan 31, 2010

I've developed a simple script to send a personalised email to multiple recipients. I would like to develop it to be able to send HTML formatted emails.

View 2 Replies View Related

Send Form To Multiple Recipients From Website

Jun 17, 2007

I have a form on my site for people to register with my company. I receive the form with the details via email which is fine. Is it possible to send an altered version of the form to the person who filled it out also i.e. a sort of automated confirmation email of their details. Can this be done from the same script which sends the original email?

View 1 Replies View Related

Contact Form - Spam Protected For Multiple Recipients

Feb 3, 2006

I'm trying to build a contact form for multiple recipients that hides the recipient emails. I'm fairly sure the logic is correct, though the syntax is wrong as I get this error when posting to the php form processor: Parse error: parse error, unexpected '@'

Can anyone help? v

View 7 Replies View Related

Send To Multiple Recipients When User Types "message And Email Id's" In Form

Jul 21, 2010

I am able to send email to one email id by defining the id in the mailer, but i am not able to understand how to send to multiple recepients when an user types "mssage and email id's" in a form. Ex - I am showing a form with two text areas - one for email id's and one for custom message. So when they click send, i want to take the email id's from that text area and send that message to those ids. I am yet to figure out how to comma/space seperate the emailds but will try it in google search.

View 4 Replies View Related

Send Mail To Multiple Emails At Once With Mail() Function?

Jan 29, 2011

I really need your help with this because i have tried every means i know but all to no avail.

View 4 Replies View Related

Multiple Mail Like 10000 Mail Have To Send?

Oct 31, 2009

I have facing problem sending multiple mail to the multiple user through php mail function. But i am not able to do so .There are thousands of email addresses in database and i have to send all of them mail.

View 1 Replies View Related

Too Many Recipients?

Jul 14, 2007

I've searched everywhere, but can't find any information that might help.

I'm trying to send out e-mails to our forum members... we've had a tremendous growth lately, and unfortunately a LOT of spammers; the membership has now reached about 3400....

When trying to send an e-mail I receive a php error message... I tried to attach a copy, but was unable to do so.

The message reads: "Ran into problems sending Mail. Response: 550 sorry, too many recipients (#5.7.1)"

Line : 165
File : smtp.php

I read in one post that there was no limit to the number of persons an e-mail could be sent to, so don't know if this is caused by this particular program or not.

View 1 Replies View Related

Email Recipients

Apr 19, 2002

why is it that only the first email is working the other email is not receiving this email :

$recipient = "info <>" . ",";
$recipient = "$name <$email>";

the $email is coming out ok when i see in the email but i that account is not getting the email why?

View 4 Replies View Related

Choice Of Recipients

Mar 29, 2007

I need to create a PHP form that, when submited, is sent to one of three e-mail addresses. The relevant e-mail address will be appropriated by a drop down box in the form that lists 3 different locations. I.e. If the user selects the drop down location of London as their nearest location the form will be sent to If they select Portsmouth the form will be sent to etc.

View 10 Replies View Related

Form Email Not Getting To Some Recipients

Nov 3, 2005

I am testing a form-to-email contact form for one of my clients. The script is written in PHP and is set up to send email to 3 or 4 recipients plus a copy to the sender.

Two of the recipients are not getting their copies of the email. I have worked with one of the recipients trying different possible fixes including having the recipient add the email's "from" address to their address book. Still he can't get the messages.

The firm uses an internal MS mailserver for their email accounts. But the problem is only happening with two of the four recipients, so I don't consider the problem to be at the server level... at least it is less likely.

Any clues as to what might be causing the problem? Anything I can try to isolate and identify the problem?

View 1 Replies View Related

Email Recipients On A Form

Oct 6, 2004

I'm in the process of altering a prewritten PHP script that handles data from a form and sends a copy to the hard-coded address stated in: $incoming_mailto = ""; I know I need to make it into a multiple field for people to select who they are sending it to like:

<input type="checkbox" name="incoming_mailto[]" value="">The Boss</input><br>
<input type="checkbox" name="incoming_mailto[]" value="">The Accountant</input><br>
<input type="checkbox" name="incoming_mailto[]" value="">The Office Manager</input>

But I'm drawing a blank on how I set the form to handle the results so that each checkbox that is checked will be mailed a copy of the form. I can't seem to get past having only one email sent regardless of how many boxes are checked.

View 1 Replies View Related

Sending Emails To Several Recipients?

Jun 12, 2011

I started managing a website with a member list of over 50,000 registered members.

I am having this problem:

Each time i try sending the emails, the page runs for several minutes (more than 20 minutes) and eventually ends with up 'Internal Server Error'.

Now, i do not know how many mails that were sent or if any was sent at all.

How do i send the emails:

I select all emails from the database, run a loop and send one after the other. I chose this option because:

i do not want to add several emails in 'To' field, so people's privacy will be maintained.
Adding the emails in Bcc will make it appear as a spam.

View 3 Replies View Related

Multiple Mail

Jul 17, 2001

I have just managed to get the mail () function working Having spent ages thinking I was a total dunce I found out that my ISP hadn't configured the php.ini file correctly -

Now I want to get adventurous and want to send two different emails to two separtate places within one php file. The code I have written is as follows (the second email also includes a cc): Code:

View 14 Replies View Related

Multiple Mail()

Aug 11, 2007

how do you mail to multiple people?

$name = $_POST["namee"];
$sendTo = "";
$subject = "Prompt Service Estimate";
$headers = "From: " . $_POST["namee"] .">";
$headers .= "Reply-To: " . $_POST["email"] . "";
$headers .= "Return-path: " . $_POST["email"];
$message = "Name:: " . $_POST["namee"] ."";
$message .= "Email:: " . $_POST["email"] ."";
$message .= "Home Phone:: " . $_POST["hphone"] .";
$message .= "Cell Phone:: " . $_POST["cphone"] ."";
$message .= "Address:: " . $_POST["adres"] ."";
$message .= "Message:: " . $_POST["message"];

mail($sendTo, $subject, $message, $headers);

would i just add $sendTo .= "other address"; as many times as needed?

View 3 Replies View Related

Form Coding - Emailed To Different Recipients?

Jul 23, 2011

I'm a newbie and don't know much about PHP coding, although I can go in and edit and I can usually change values and such. I've done a lot of browsing and I've tried to read up a bit on W3 schools, however I'm struggling.I have an info request form that has built in spam prevention (I found this form online) and I'm trying to figure out a way to integrate in some coding that will allow me to submit the form to different emails.

I've been looking around online and I found similar questions and solutions for this, however I really need to keep the spam prevention, and I'm really not sure how to merge my form with the solutions that I've found.

Here is my coding:

PHP Code:

if (isset($_POST["op"]) && ($_POST["op"]=="send")) {

/******** START OF CONFIG SECTION *******/[code]....

View 4 Replies View Related

Form Not Showing Up In Recipients Mailbox?

Nov 20, 2008

My form does not go to recipient when submitted! I changed the file mail.tpl.txt to direct to my own email address as a test and I got the email just fine. Client has checked junk mail folder as well and he is just not getting information. Below is the form code, followed by the code from mail.tpl.txt and then the form's index.php code. Everything looks okay to me, so I am asking if someone has any idea why he wouldn't be getting the form. Here's the form code:

<form id="contactForm" name="form" action="form/index.php" method="post">
<legend><font color="#000000"><strong>Please fill out the form below if you have any questions.</strong></font></legend>


View 3 Replies View Related

Parsing - Get All Recipients From Email To Header (ZF Is Bonus)

Mar 1, 2011

Is there a way to parse the recipients of an email with the Zend Framework? I'm asking, because email TO headers can contain something like this: To:, "Lastname, Firstname" <[URL] So I can't just split on the comma. I didn't find a way to do this with the Zend Framework Mail class. How do you do this? And is there a way to easily do this with the Zend Framework?

View 3 Replies View Related

Multiple Attachments With Mail()

Dec 23, 2002

I made the following script, but it only sends 1 attachment even if $aantalgef>1. Does anybody know why? PHP Code:

View 1 Replies View Related

Multiple Mail Attachment

Jul 31, 2001

How do enable the people to attach more than one file? This is portion of my code but it enable only one file to be attach. May i know what's wrong with it? Code:

View 1 Replies View Related

Copyrights 2005-15, All rights reserved