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 'rmail@email.com ' 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.

View 3 Replies


ADVERTISEMENT

Mail $to Multiple Recipients From Database Table?

<?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

Mail Function To Send To Multiple Recipients

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 = "me@yourname.com";
$contactname = "Administrator";
$contactemail = "me@yourname.com";

$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";

$toText="me@yourname.com";
$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

Mail To Multiple Recipients From Query Result

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

Mail Function To Send To Multiple Recipients?

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 = "me@yourname.com";
$contactname = "Administrator";
$contactemail = "me@yourname.com";
$headers .= "MIME-Version: 1.0
";
$headers .= "Content-type: text/html; charset=iso-8859-1

[Code]...

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

Send E-mail To Multiple Recipients From Database Query ?

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

PHPmailer Multiple Recipients Error 'Could Not Instantiate Mail Function'

I have the following code with PHPmailer:

$tomailn[0] = 'imap2@gazler.com';
$tomailn[1] = 'imap@gazler.com';
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

Send Mail To Mulitple Recipients Using The Mail Finction?

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

View 2 Replies

Sending Mail To Different Recipients?

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

<?php
$recipient = $_POST["to"];
switch ($recipient) {
case(1):
$name = "Tom Burdi";

[Code]....

View 7 Replies

Form Mail Hide Recipients?

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

Php Mail Function - Use Different Subject Based On The Recipients

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

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

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

Code:
$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 'domain.com', it works....Is there somthing wrong with my script, or do you think its an issue with the host?

View 1 Replies

Send Mails With Mail() Hide Recipients Address?

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

Send An Email To Multiple Recipients

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

Multiple Recipients Of Form Data

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

To do this which one of these is correct?

$mailto = 'kingcantona1999@yahoo.co.uk, jacksparrow@poc.co.uk' ;

OR

$mailto = 'kingcantona1999@yahoo.co.uk','jacksparrow@poc.co.uk' ;

if neither...how do I do it?

View 2 Replies

Sending An Email To Multiple Recipients

<?
session_start();
session_register('LifeZip');
session_register('LifeEmail');
// connect to db
code....

View 1 Replies

Email Multiple Recipients In Recordset?

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

Contact Form With Multiple Recipients?

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:
<h1>Contact Us</h1>
<form action="contact_form.php" method="post">
[code].......

View 3 Replies

Mailing Form To Multiple Recipients

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>
<br>
<input type="text" name="email" size="19"><br>
<br>
<textarea rows="9" name="message" cols="30">

View 2 Replies

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

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

Send Email To Multiple Recipients In Mysql Db?

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.

<?php
//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) )

[Code]...

View 1 Replies

Send A Personalised Email To Multiple Recipients?

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

Send Form To Multiple Recipients From Website

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

Contact Form - Spam Protected For Multiple Recipients

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

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

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

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

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

View 4 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved