architecture to send lots of mail in php apart from mail() function

172 Views Asked by At

I want to ask that I can send mass mail using PHP mail() function, but the thing is that it is slow and after reading from other posts the reason is that this mail function open the socket and close the socket every time it sends a mail (correct me if I am wrong). Which makes it slow.

So I found other things to over come this problem like phpmailer but I don't want any tool all I want is to get the right way through which I can send mail much faster and looks more prominent.

Like I have this in my mind:

  1. create a file which can save the mail data and store into a file and other file can then run which reads the file and fetch user mails from table and send them 1 by 1. But I am stuck with how to send those mail without mail() function?
2

There are 2 best solutions below

0
On

you use to direct mail function in your php file

mail(to,subject,message,headers,parameters)  

and you also referred

http://www.w3schools.com/php/func_mail_mail.asp

and you also referred one more site

https://www.php.net/manual-lookup.php?pattern=mail+function&scope=quickref

all this site help full for your problem....

0
On

Have you even looked at any frameworks? Something like Swift Mailer will suit you.