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

Member Avatar for GreenDay2001

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

// 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);	
}
commented: Helpful post +2

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.