This additional_parameter can be used to pass additional flags to the Sendmail program as configured in the sendmail_path configuration setting. You can set the From header, either by using the additional_headers parameter or, you can also set a default value in php.ini. Note: While sending the email, make sure there is a From header. Each additional headers should be separated with a CRLF (\r\n). This parameter is used to pass any additional email headers like From, Cc and Bcc. To resolve this, replace the dot with a double dot, using the below code: In case of Windows machine, when PHP is connecting to an SMTP server to sendmail, it removes a full stop which is found at the start of a line. Each line of the email should be separated with a CRLF (\r\n) and each line should not exceed 70 characters. The content of the mail that you want to send. Note, the subject must comply with RFC 2047. The subject line of the email to be sent. You can pass one email address or multiple using comma-separated.įew sample examples of how the values will look like: Mail (to,subject,message,headers,parameters) In case your PHP setup is not configured for sending email to the outside world, then please refer the steps mentioned at the end of this article. Here in this tutorial, we will be talking about the prerequisites to sending a mail directly from a PHP script, the syntax, and its parameters. PHP comes with a default function mail() that allows you to sendmail directly from a PHP script. The author voluntarily contributed this tutorial as a part of Pepipost Write to Contribute program.
0 Comments
Leave a Reply. |