How to send mails through php script?

前端 未结 8 1070
半阙折子戏
半阙折子戏 2021-01-01 08:02

How can i send mails through the php script?? I am trying to do somthing like this:

for($k=0;$k<=$x->length-1;$k++)
{
    for($l=0;$l<=$j-1;$l++)
           


        
8条回答
  •  不知归路
    2021-01-01 08:21

    I strongly advise against sending mail using PHP's mail() function. Composing valid emails and delivering them successfully is trickier than it seems at first glance. There is encoding, putting parts together, validation & sanitation, error reporting (more than bool mail(...)), support for authentication and on and on ... The mail() function does not offer any of these things.

    Try SwiftMailer or similar. You can configure it to use PHP's mail() function and so much more. I highly recommend it.

提交回复
热议问题