Coder Social home page Coder Social logo

eMail issues with PHP mail()... about mybb HOT 3 CLOSED

exdiogene avatar exdiogene commented on September 22, 2024
eMail issues with PHP mail()...

from mybb.

Comments (3)

dvz avatar dvz commented on September 22, 2024

Looks like it was supposed to address some specific 3rd party problems:

// For some reason sendmail/qmail doesn't like \r\n

Possibly related: php/php-src#8086

from mybb.

exdiogene avatar exdiogene commented on September 22, 2024

If we refer to the PHP Mail() function description it seem preferable to use an Array for data transfer instead of not knowing if it is a CRLF or a LF that should be used in the user hosting environment?

Hoping that PHP would format the mail properly with the Array...

mail

(PHP 4, PHP 5, PHP 7, PHP 8)

mail — Send mail
Description
mail(
string $to,
string $subject,
string $message,
array|string $additional_headers = [],
string $additional_params = ""
): bool

additional_headers (optional)

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

This is typically used to add extra headers (From, Cc, and Bcc). Multiple extra headers should be separated with a CRLF (\r\n). If outside data are used to compose this header, the data should be sanitized so that no unwanted headers could be injected.

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

    ...
    ...

    Note:

    If messages are not received, try using a LF (\n) only. Some Unix mail transfer agents (most notably » qmail) 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 » RFC 2822. 

from mybb.

dvz avatar dvz commented on September 22, 2024

Yes, one solution may be to split the final string with the used delimiter to pass an array on PHP >= 7.2.0 (when array became an accepted type for the parameter).

from mybb.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.