PHP.nl

mb_send_mail

mb_send_mail

Send encoded mail

bool **mb_send_mail** string $to string $subject string $message  $additional_headers  $additional_params

Sends email. Headers and messages are converted and encoded according to the setting. It's a wrapper function for , so see also for details. mb_language``mail``mail

to The mail addresses being sent to. Multiple recipients may be specified by putting a comma between each address in . This parameter is not automatically encoded. to

subjectThe subject of the mail.

messageThe message of the mail.

additional_headers or to be inserted at the end of the email header. String``array

This is typically used to add extra headers (From, Cc, and Bcc). Multiple extra headers should be separated with a CRLF (\r\n). Validate parameter not to be injected unwanted headers by attackers.

   If an  is passed, its keys are the header names and its
   values are the respective header values.
  `array`

Opmerking: > When sending mail, the mail contain a header. This can be set with the parameter, or a default can be set in php.ini. mustFrom``additional_headers

    Failing to do this will result in an error
    message similar to .
    The  header sets also
     under Windows.
   `Warning: mail(): "sendmail_from" not
    set in php.ini or custom "From:" header missing``From``Return-Path`

Opmerking: > If messages are not received, try using a LF (\n) only. Some Unix mail transfer agents (most notably ) replace LF by CRLF automatically (which leads to doubling CR if CRLF is used). This should be a last resort, as it does not comply with . qmailRFC 2822

additional_params is a MTA command line parameter. It is useful when setting the correct Return-Path header when using sendmail. additional_params

   This parameter is escaped by  internally
   to prevent command execution.  prevents
   command execution, but allows to add additional parameters. For security reason,
   this parameter should be validated.
  `escapeshellcmd``escapeshellcmd`


   Since  is applied automatically, some characters
   that are allowed as email addresses by internet RFCs cannot be used. Programs
   that are required to use these characters  cannot be used.
  `escapeshellcmd``mail`

The user that the webserver runs as should be added as a trusted user to the sendmail configuration to prevent a 'X-Warning' header from being added to the message when the envelope sender (-f) is set using this method. For sendmail users, this file is .

return.success

mail``mb_encode_mimeheader``mb_language