Hi
I have developed a web site, which is a forum. Health related question answer forum. In that after registering users and doctors, the doctors are divided according to their pathy like Dermatology , Skin specialist, Pediatric, Homeopath and many more. So suppose user ask a question related to skin disease, then a mail should go to all the doctors in the skin speciality ( there may be 10,20, 40 or more doctors).
My query is
1) How i can achieve ( i have used PHPMailer for sending simple contact us mail or registration mail ).
2) According to me the solution is :-- taking all the necessary email ids from the DB and loop the content for every email id. Is this solution correct then
while sending the mail it will take too much time to send and loop through 40 or 50 email id.
3) I need any other solution just to speed up the process or is there any different approach to this.
I need this in very urgent.
Thanking You In advance.

Kedar PawgiPosted Mar 12, 2015, 3:00 AM
Thanks For the reply..I am reading all your links. I am really sorry...i forgot to tell you that i have developed that web site in PHP and DB is Mysql. But thanks for the link you send, at least i will get an idea how stored procedure works, i will search same for Mysql. Thanks again from you.
Prasham SabadraPosted Mar 11, 2015, 1:09 PM
No Problem.
Stored Procedure means, executing the code at db side no need to get the data in server code and send the mail. So that performance will be improved.
Stored Procedures:
https://technet.microsoft.com/en-us/library/aa174792(v=sql.80).aspx
http://www.codeproject.com/Articles/38682/Overview-of-SQL-Server-Stored-Procedure
In stored procedure you need to get the data and send the mail.
https://msdn.microsoft.com/en-IN/library/ms190307.aspx
http://support.microsoft.com/kb/312839
https://www.emailarchitect.net/easendmail/kb/sql.aspx
Your approach is right but because of performance constraint I suggested stored procedure approach.
I believe there should not be any server side constraint.
Please let me know if you will require more details.
Kedar PawgiPosted Mar 11, 2015, 9:43 AM
thanks for the reply. But is it possible for you to just explain about the stored procedure. Actually i just need to fetch the email addresses from the DB. I will write the code in PHPMailer and send.
So can you explain what i need to write in the stored procedure.
I will be very thankful.
Another thing is the approach i made is correct or wrong, is there any other procedure to execute this. Do i have to change any hosting server side changes.
Does is there any server side constraint like (limited no of mails can be send in 1 go ) will affect the thing.
Sorry for so big queries again
I will be very thankful if u reply me back asap.
Thanks in advance.
Prasham SabadraPosted Mar 11, 2015, 8:07 AM
For speed up one possible option is,
rather than getting the result from DB, if you write store procedure and send mail from there then it will improve the performance.