Sending Bulk Emails in PHP with PHPMailer

Sending Bulk Emails in PHP with PHPMailer

In this Post We Will Explain About is Sending Bulk Emails in PHP with PHPMailer With Example and Demo.Welcome on Pakainfo.com – Examples, The best For Learn web development Tutorials,Demo with Example! Hi Dear Friends here u can know to php – Sending bulk mail using phpmailer Example

In this post we will show you Best way to implement php – How to Send Bulk Emails via Phpmailer, hear for how to send unlimited emails with free php mailer with Download .we will give you demo,Source Code and examples for implement Step By Step Good Luck!.

index.js

$(document).ready(function(){
$('.send_email').click(function(){
$(this).attr('disabled', 'disabled');
var id = $(this).attr("id");
var data_action = $(this).data("data_action");
var email_list_data = [];
if(data_action == 'single')
{
email_list_data.push({
email: $(this).data("email"),
name: $(this).data("name")
});
}
else
{
$('.single_student').each(function(){
if($(this). prop("checked") == true)
{
email_list_data.push({
email: $(this).data("email"),
name: $(this).data('name')
});
}
});
}

$.ajax({
url:"send_mail.php",
method:"POST",
data:{email_list_data:email_list_data},
beforeSend:function(){
$('#'+id).html('Email Sending...');
$('#'+id).addClass('live btn-danger');
},
success:function(data){
if(data = 'ok')
{
$('#'+id).text('Good Luck Success');
$('#'+id).removeClass('live btn-danger');
$('#'+id).removeClass('live btn-primary');
$('#'+id).addClass('live btn-success');
}
else
{
$('#'+id).text(data);
}
$('#'+id).attr('disabled', false);
}

});
});
});

index.php

prepare($query);
$statement->execute();
$result = $statement->fetchAll();
?>

 
<div class="live container">
<h3 align="center">Send Bulk Email using PHPMailer with PHP Ajax Example</h3>

<hr />

<div class="live table-responsive"><?php
$count = 0;
foreach($result as $dataRow)
{
$count++;
echo '';
}
?>
<table class="live table">
<tbody>
<tr>
<th>Student Name</th>
<th>Student Email</th>
<th>Student Select</th>
<th>Student Action</th>
</tr>
<tr>
<td>'.$dataRow["student_name"].'</td>
<td>'.$dataRow["student_email"].'</td>
<td></td>
<td><button id="'.$count.'" class="btn btn-primary btn-xs send_email" name="send_email" type="button">Send Single</button></td>
</tr>
<tr>
<td colspan="3"></td>
<td><button id="data_lots_email" class="live btn btn-primary send_email" name="data_lots_email" type="button">Send Email</button></td>
</tr>
</tbody>
</table>
</div>
</div>

send_mail.php

IsSMTP(); //put PHP Mailer to send particuler comments using SMTP serever
$sendMail->Host = 'smtpout.secureserver.net'; //put the SMTP serever some hosts set of your Email hosting any, this for like as a Godaddy
$sendMail->Port = '80'; //put the default set SMTP server port
$sendMail->SMTPAuth = true; //put SMTP authentication. as well as Utilizes the phpmailer user Username and user Password variables
$sendMail->Username = '[email protected]'; //put SMTP server username
$sendMail->Password = '[email protected]#hrt$%'; //put SMTP server password
$sendMail->SMTPSecure = ''; //put data connection prefix. Options like as are "", "ssl" as well as "tls"
$sendMail->From = '[email protected]'; //put the From email user address for the comments
$sendMail->FromName = 'live24u'; //put the HTML From name of the formname
$sendMail->AddAddress($dataRow["email"], $dataRow["name"]); //simple add here a "To" address
$sendMail->WordWrap = 50; //put word wrapping on the html body of the comments to a given number of characters
$sendMail->IsHTML(true); //put comments type to HTML
$sendMail->Subject = 'Live24u is the most popular Programming & Web Development blog.'; //put the Subject of the comments
//An HTML all data or plain text send email comments body
$sendMail->Body = '

Live24u is the most popular Programming & Web Development blog. Our mission is to provide the best online resources on programming and web development. We deliver the useful and best tutorials for web professionals — developers, programmers, freelancers and site owners. Any visitors of this site are free to browse our tutorials, live demos and download scripts.

Our mission is to provide the best online resources on web development.
We deliver the useful and best tutorials for web professionals — developers, programmers, freelancers and site owners.

';

$sendMail->AltBody = '';

$result = $sendMail->Send(); //Send an Email. and then Return true on data success or false on error generated

if($result["code"] == '400')
{
$message_body .= html_entity_decode($result['full_error']);
}

}
if($message_body == '')
{
echo 'ok';
}
else
{
echo $message_body;
}
}

?>

You are Most welcome in my youtube Channel Please subscribe my channel. and give me FeedBack.
More Details……
Angularjs Example

Read Also:  Laravel Advanced Eloquent Tips and Tricks

Example

I hope you have Got What is Sending Bulk Emails in PHP with PHPMailer And how it works.I would Like to have FeedBack From My Blog(Pakainfo.com) readers.Your Valuable FeedBack,Any Question,or any Comments about This Article(Pakainfo.com) Are Most Always Welcome.


Related FAQ

Here are some more FAQ related to this Article:

  1. Read Also:  PHP Quiz Application Using jQuery Ajax MySQL and Bootstrap
  2. Read Also:  Simple Vuejs Date Filter Example
  3. Read Also:  Bash if else statement using Bash Scripting
  4. Read Also:  Full form of Domain Name Extensions
  5. Read Also:  Laravel 6 CSRF Protection Token Examples
  6. Read Also:  how to store json data in mysql using php?
  7. Read Also:  PHP Magento extension soap must be loaded error
  8. Read Also:  how to fetch and update data from database in php?
  9. Read Also:  create custom seo friendly url in vuejs Example
  10. Read Also:  How To Create Contact Form With PHPMailer To Send Mails