Welcome to Software Development on Codidact!
Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.
Post History
I host my website on a CentOS-Bash, PHP and MySQL environment; my local email client is engined by Roundcube. I don't know almost anything about PHP nuances. While my web domain registration is do...
Question
php
#5: Post edited
- I host my website on a CentOS-Bash, PHP and MySQL environment; my local email client is engined by [Roundcube][1]. I don't know almost anything about PHP nuances.
- While my web domain registration is done by one company, my _DNS records hosting_, _websites hosting_ and _website emails hosting_ are all done by a second company.
- ---
I can send emails to myself (to my local email client) via running in terminal `php example_1.php`:- <?php
- $to = "example@example.com";
- $subject = "Email Test";
- $message = "PHP's mail function test";
- mail($to, $subject, $message);
- ?>
**I can't** send emails to myself (to my local email client) via running in terminal `php example_2.php`:- <?php
- $to = "example@example.com";
- $subject = "New email message";
- $message = array (
- $name = $_POST["name"] . "Name:" . "\r\n",
- $email = $_POST["email"] . "Email:" . "\r\n",
- $phone = $_POST["phone"] . "Phone:" . "\r\n",
- $topic = $_POST["topic"] . "Topic:" . "\r\n",
- $date = $_POST["date"] . "Date:" . "\r\n",
- $time = $_POST["time"] . "Time:" . "\r\n",
- $notes = $_POST["notes"] . "Notes:" . "\r\n"
- );
- mail($to, $subject, $message);
- ?>
- What might cause messages by the second example pattern not to reach my email box?
- [1]: https://roundcube.net/
- I host my website on a CentOS-Bash, PHP and MySQL environment; my local email client is engined by [Roundcube][1]. I don't know almost anything about PHP nuances.
- While my web domain registration is done by one company, my _DNS records hosting_, _websites hosting_ and _website emails hosting_ are all done by a second company.
- ---
- I can send emails to myself (to my local email client) via running in terminal `php example_1.php` with:
- <?php
- $to = "example@example.com";
- $subject = "Email Test";
- $message = "PHP's mail function test";
- mail($to, $subject, $message);
- ?>
- **I can't** send emails to myself (to my local email client) via running in terminal `php example_2.php` with:
- <?php
- $to = "example@example.com";
- $subject = "New email message";
- $message = array (
- $name = $_POST["name"] . "Name:" . "\r\n",
- $email = $_POST["email"] . "Email:" . "\r\n",
- $phone = $_POST["phone"] . "Phone:" . "\r\n",
- $topic = $_POST["topic"] . "Topic:" . "\r\n",
- $date = $_POST["date"] . "Date:" . "\r\n",
- $time = $_POST["time"] . "Time:" . "\r\n",
- $notes = $_POST["notes"] . "Notes:" . "\r\n"
- );
- mail($to, $subject, $message);
- ?>
- What might cause messages by the second example pattern not to reach my email box?
- [1]: https://roundcube.net/
#4: Post edited
- I host my website on a CentOS-Bash, PHP and MySQL environment; my local email client is engined by [Roundcube][1]. I don't know almost anything about PHP nuances.
- While my web domain registration is done by one company, my _DNS records hosting_, _websites hosting_ and _website emails hosting_ are all done by a second company.
- ---
- I can send emails to myself (to my local email client) via running in terminal `php example_1.php`:
- <?php
- $to = "example@example.com";
- $subject = "Email Test";
- $message = "PHP's mail function test";
- mail($to, $subject, $message);
- ?>
- **I can't** send emails to myself (to my local email client) via running in terminal `php example_2.php`:
- <?php
$to = "example@example.com";$subject = "New email message";$message = array ($name = $_POST["name"] . "Name:" . "",$email = $_POST["email"] . "Email:" . "",$phone = $_POST["phone"] . "Phone:" . "",$topic = $_POST["topic"] . "Topic:" . "",$date = $_POST["date"] . "Date:" . "",$time = $_POST["time"] . "Time:" . "",$notes = $_POST["notes"] . "Notes:" . "");mail($to, $subject, $message);- ?>
- What might cause messages by the second example pattern not to reach my email box?
- [1]: https://roundcube.net/
- I host my website on a CentOS-Bash, PHP and MySQL environment; my local email client is engined by [Roundcube][1]. I don't know almost anything about PHP nuances.
- While my web domain registration is done by one company, my _DNS records hosting_, _websites hosting_ and _website emails hosting_ are all done by a second company.
- ---
- I can send emails to myself (to my local email client) via running in terminal `php example_1.php`:
- <?php
- $to = "example@example.com";
- $subject = "Email Test";
- $message = "PHP's mail function test";
- mail($to, $subject, $message);
- ?>
- **I can't** send emails to myself (to my local email client) via running in terminal `php example_2.php`:
- <?php
- $to = "example@example.com";
- $subject = "New email message";
- $message = array (
- $name = $_POST["name"] . "Name:" . "
- ",
- $email = $_POST["email"] . "Email:" . "
- ",
- $phone = $_POST["phone"] . "Phone:" . "
- ",
- $topic = $_POST["topic"] . "Topic:" . "
- ",
- $date = $_POST["date"] . "Date:" . "
- ",
- $time = $_POST["time"] . "Time:" . "
- ",
- $notes = $_POST["notes"] . "Notes:" . "
- "
- );
- mail($to, $subject, $message);
- ?>
- What might cause messages by the second example pattern not to reach my email box?
- [1]: https://roundcube.net/
#3: Post edited
I host my website on a CentOS-Bash, PHP and MySQL environment; my local email client is engined by [Roundcube][1].- While my web domain registration is done by one company, my _DNS records hosting_, _websites hosting_ and _website emails hosting_ are all done by a second company.
- ---
- I can send emails to myself (to my local email client) via running in terminal `php example_1.php`:
- <?php
- $to = "example@example.com";
- $subject = "Email Test";
- $message = "PHP's mail function test";
- mail($to, $subject, $message);
- ?>
- **I can't** send emails to myself (to my local email client) via running in terminal `php example_2.php`:
- <?php
- $to = "example@example.com";
- $subject = "New email message";
- $message = array (
- $name = $_POST["name"] . "Name:" . "\r\n",
- $email = $_POST["email"] . "Email:" . "\r\n",
- $phone = $_POST["phone"] . "Phone:" . "\r\n",
- $topic = $_POST["topic"] . "Topic:" . "\r\n",
- $date = $_POST["date"] . "Date:" . "\r\n",
- $time = $_POST["time"] . "Time:" . "\r\n",
- $notes = $_POST["notes"] . "Notes:" . "\r\n"
- );
- mail($to, $subject, $message);
- ?>
- What might cause messages by the second example pattern not to reach my email box?
- [1]: https://roundcube.net/
- I host my website on a CentOS-Bash, PHP and MySQL environment; my local email client is engined by [Roundcube][1]. I don't know almost anything about PHP nuances.
- While my web domain registration is done by one company, my _DNS records hosting_, _websites hosting_ and _website emails hosting_ are all done by a second company.
- ---
- I can send emails to myself (to my local email client) via running in terminal `php example_1.php`:
- <?php
- $to = "example@example.com";
- $subject = "Email Test";
- $message = "PHP's mail function test";
- mail($to, $subject, $message);
- ?>
- **I can't** send emails to myself (to my local email client) via running in terminal `php example_2.php`:
- <?php
- $to = "example@example.com";
- $subject = "New email message";
- $message = array (
- $name = $_POST["name"] . "Name:" . "\r\n",
- $email = $_POST["email"] . "Email:" . "\r\n",
- $phone = $_POST["phone"] . "Phone:" . "\r\n",
- $topic = $_POST["topic"] . "Topic:" . "\r\n",
- $date = $_POST["date"] . "Date:" . "\r\n",
- $time = $_POST["time"] . "Time:" . "\r\n",
- $notes = $_POST["notes"] . "Notes:" . "\r\n"
- );
- mail($to, $subject, $message);
- ?>
- What might cause messages by the second example pattern not to reach my email box?
- [1]: https://roundcube.net/
#2: Post edited
I have a right-to-left (RTL) website in Hebrew. I host my website on a CentOS-Bash, PHP and MySQL environment; my local email client is engined by [Roundcube][1].- While my web domain registration is done by one company, my _DNS records hosting_, _websites hosting_ and _website emails hosting_ are all done by a second company.
- ---
- I can send emails to myself (to my local email client) via running in terminal `php example_1.php`:
- <?php
- $to = "example@example.com";
- $subject = "Email Test";
- $message = "PHP's mail function test";
- mail($to, $subject, $message);
- ?>
- **I can't** send emails to myself (to my local email client) via running in terminal `php example_2.php`:
- <?php
- $to = "example@example.com";
- $subject = "New email message";
- $message = array (
- $name = $_POST["name"] . "Name:" . "\r\n",
- $email = $_POST["email"] . "Email:" . "\r\n",
- $phone = $_POST["phone"] . "Phone:" . "\r\n",
- $topic = $_POST["topic"] . "Topic:" . "\r\n",
- $date = $_POST["date"] . "Date:" . "\r\n",
- $time = $_POST["time"] . "Time:" . "\r\n",
- $notes = $_POST["notes"] . "Notes:" . "\r\n"
- );
- mail($to, $subject, $message);
- ?>
- What might cause messages by the second example pattern not to reach my email box?
- [1]: https://roundcube.net/
- I host my website on a CentOS-Bash, PHP and MySQL environment; my local email client is engined by [Roundcube][1].
- While my web domain registration is done by one company, my _DNS records hosting_, _websites hosting_ and _website emails hosting_ are all done by a second company.
- ---
- I can send emails to myself (to my local email client) via running in terminal `php example_1.php`:
- <?php
- $to = "example@example.com";
- $subject = "Email Test";
- $message = "PHP's mail function test";
- mail($to, $subject, $message);
- ?>
- **I can't** send emails to myself (to my local email client) via running in terminal `php example_2.php`:
- <?php
- $to = "example@example.com";
- $subject = "New email message";
- $message = array (
- $name = $_POST["name"] . "Name:" . "\r\n",
- $email = $_POST["email"] . "Email:" . "\r\n",
- $phone = $_POST["phone"] . "Phone:" . "\r\n",
- $topic = $_POST["topic"] . "Topic:" . "\r\n",
- $date = $_POST["date"] . "Date:" . "\r\n",
- $time = $_POST["time"] . "Time:" . "\r\n",
- $notes = $_POST["notes"] . "Notes:" . "\r\n"
- );
- mail($to, $subject, $message);
- ?>
- What might cause messages by the second example pattern not to reach my email box?
- [1]: https://roundcube.net/
#1: Initial revision
PHP emails are sent when $message is a string, but not when its an array
I have a right-to-left (RTL) website in Hebrew. I host my website on a CentOS-Bash, PHP and MySQL environment; my local email client is engined by [Roundcube][1]. While my web domain registration is done by one company, my _DNS records hosting_, _websites hosting_ and _website emails hosting_ are all done by a second company. --- I can send emails to myself (to my local email client) via running in terminal `php example_1.php`: <?php $to = "example@example.com"; $subject = "Email Test"; $message = "PHP's mail function test"; mail($to, $subject, $message); ?> **I can't** send emails to myself (to my local email client) via running in terminal `php example_2.php`: <?php $to = "example@example.com"; $subject = "New email message"; $message = array ( $name = $_POST["name"] . "Name:" . "\r\n", $email = $_POST["email"] . "Email:" . "\r\n", $phone = $_POST["phone"] . "Phone:" . "\r\n", $topic = $_POST["topic"] . "Topic:" . "\r\n", $date = $_POST["date"] . "Date:" . "\r\n", $time = $_POST["time"] . "Time:" . "\r\n", $notes = $_POST["notes"] . "Notes:" . "\r\n" ); mail($to, $subject, $message); ?> What might cause messages by the second example pattern not to reach my email box? [1]: https://roundcube.net/