0

I have a registration form which sends confirmation email to the new user. i also want the same email to be sent to all registered users.

I have a table containing all registered members email and i need to inform all of them of the new user.

This is what i have so far and i need help in achieving this.

<?php
//define the receiver of the email
$to = 'youraddress@example.com';
//define the subject of the email
$subject = 'Test email';
//define the message to be sent. Each line should be separated with \n
$message = "Hello World!\n\nThis is my first mail.";
//define the headers we want passed. Note that they are separated with \r\n
$headers = "From: webmaster@example.com\r\nReply-To: webmaster@example.com";
//send the email
$mail_sent = @mail( $to, $subject, $message,$serder, $headers );
//if the message is sent successfully print "Mail sent". Otherwise print "Mail failed"
echo $mail_sent ? "Mail sent" : "Mail failed";
?>

3
Contributors
2
Replies
3
Views
5 Years
Discussion Span
Last Post by Javvy
0

You could select all User email address and create an array.

Then use the array in the BCC field (that way no one gets other peoples email address')

0

You can just submit the array? I'm not sure about this but you can separate the email addresses with a "," for multiple recipients.

And if they email addresses should remain as private, BCC as Squidge suggested.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.