0

Hi,
I want to send bulk emails to my registered users.
is there is any software or should i done with the help of PHP.
Need help & suggestions

4
Contributors
3
Replies
4
Views
6 Years
Discussion Span
Last Post by rajeesh_rsn
1

You can either put a loop sending mails one by one or use a Mailing List script/software.

1

// you could have a function to read your user data or for your main html to be spit out.

function format_html_email($user){
	$html ='';
        // you can 'customize' each email with specific data...
	$html = "Thanks again " . $user->get_username() . " \n";
	$html .= "This is a chain email going to all users \n";
	$html .= "This is more stuff that I want to tell them \n";
	$html .= "Thanks for being a valued member \n";
	return $html;

}

// assuming you are using a 'user' object
get all users from db; ( I would have a class and use a 'user' object)

foreach($users as $user) {
	$formatted_data = format_html_email($user);
	$to = $user->get_email_address();
	$subject = "Bulk Mail To Registered Users";
	$headers = "me@mydomain.com";
	mail($to,$subject,$formatted_data,$headers);	
}

Edited by Ezzaral: Added code tags. Please use them to format any code that you post.

Votes + Comments
Helpful post
0

Hi,

I would likes to say more elements to this question ..

1. Please take care of code while sending this SMS . Coz if you are using poor coding then that mail will put in users "SPAM" folder .. So Please make some good quality coding including correct header and all

2. Many hosting providers will block your account when such a huge loop is running. That will make their servers down. So put the mail limit with timing ..

3. So many free codes are available . Choose any good one


Cheers

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.