<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Jana</title>
    <description>The latest articles on DEV Community by Jana (@jana_f).</description>
    <link>https://dev.to/jana_f</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F376552%2Fd3e69391-1a90-40f8-8837-8b54e3626386.png</url>
      <title>DEV Community: Jana</title>
      <link>https://dev.to/jana_f</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/jana_f"/>
    <language>en</language>
    <item>
      <title>Setting up contact form for site hosted on cPanel and GoDaddy</title>
      <dc:creator>Jana</dc:creator>
      <pubDate>Sat, 11 Jul 2026 11:04:26 +0000</pubDate>
      <link>https://dev.to/jana_f/setting-up-contact-form-for-site-hosted-on-cpanel-and-godaddy-29nm</link>
      <guid>https://dev.to/jana_f/setting-up-contact-form-for-site-hosted-on-cpanel-and-godaddy-29nm</guid>
      <description>&lt;p&gt;It took me a full day to get a contact form working on cPanel, here's what I learned.&lt;/p&gt;

&lt;p&gt;The symptom was confusing: submitting the form returned a 200 and showed the success message, but nothing ever landed in the inbox. No error, no bounce, the email just quietly vanished.&lt;/p&gt;

&lt;h3&gt;
  
  
  My Setup
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;The site runs on cPanel hosting (GoDaddy, in my case).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;contact.php sends mail with PHPMailer over SMTP to the local mail server (localhost).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The owner reads enquiries in a Microsoft 365 mailbox (provisioned through GoDaddy) on the same domain as the site.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  What Went Wrong
&lt;/h3&gt;

&lt;p&gt;It helps to understand what happens when you hit "Send" by picturing the two roles involved:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The sender.&lt;/strong&gt; The mail server needs an address it's authorized to send as. It assumes that identity and hands your message off for delivery. It has to be an address the server is allowed to send for, not the visitor's address.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The receiver.&lt;/strong&gt; The site owner, who reads and replies to enquiries. In my case that mailbox lives on Microsoft 365 and shares the site's domain.&lt;/p&gt;

&lt;p&gt;Once PHPMailer authenticates and calls send(), the local server accepts the message and becomes responsible for delivering it onward. If that hand-off succeeds, PHPMailer reports success — even if the message never reaches a human. That's exactly why I saw a 200 with no email.&lt;/p&gt;

&lt;p&gt;By default, cPanel treats your domain as local - it assumes the mailboxes for that domain live on the same server. So when the form sent to &lt;a href="mailto:owner@mydomain.com"&gt;owner@mydomain.com&lt;/a&gt;, the local server dropped it into a local mailbox on the cPanel box... which nobody ever checks, because the real mailbox is on Microsoft 365. Delivery "succeeded" locally, so no error ever surfaced.&lt;/p&gt;

&lt;p&gt;This is especially easy to hit when the sending and receiving addresses share the same domain, because the local server considers itself authoritative for that domain out of the box.&lt;/p&gt;

&lt;h3&gt;
  
  
  How to Fix This
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Set Email Routing to Remote Mail Exchanger&lt;/strong&gt;. In cPanel, go to &lt;code&gt;Email → Email Routing&lt;/code&gt; and switch the domain from Local to Remote Mail Exchanger. This tells the server it is not the final destination for the domain — it should look up the MX records and deliver to Microsoft's servers, where the mailbox actually lives. This is the setting that gets your mail off the local box and onto M365.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Watch out for Microsoft 365's spoof protection&lt;/strong&gt;. Because the message's From address is on your own domain but arrives at M365 from an outside source (the cPanel server), Microsoft may treat it as spoofed and quietly quarantine or reject it. If mail still doesn't arrive after step 1, make sure the sending server is allowed to send for your domain — check your SPF record, and add an allow/mail-flow rule in M365 if needed.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Set Reply-To.&lt;/strong&gt; &lt;code&gt;from&lt;/code&gt; has to stay an address the server can send as, so if you don't set &lt;code&gt;Reply-To&lt;/code&gt;, clicking "Reply" on an enquiry would go back to the form's own sending address instead of the person who wrote in. Set the &lt;code&gt;Reply-To&lt;/code&gt; header to the visitor's address so the owner can just hit Reply and reach the actual enquirer:&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;$mail-&amp;gt;setFrom(FROM_EMAIL, FROM_NAME);   // an address the server may send as&lt;br&gt;
$mail-&amp;gt;addReplyTo($email, $name);        // the visitor who filled out the form&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Hope this helps!&lt;/p&gt;

</description>
      <category>cpanel</category>
      <category>godaddy</category>
      <category>webdev</category>
      <category>contactform</category>
    </item>
    <item>
      <title>Javascript Promise explained with a metaphor</title>
      <dc:creator>Jana</dc:creator>
      <pubDate>Mon, 01 Jun 2020 14:37:46 +0000</pubDate>
      <link>https://dev.to/jana_f/javascript-promise-explained-with-a-metaphor-2412</link>
      <guid>https://dev.to/jana_f/javascript-promise-explained-with-a-metaphor-2412</guid>
      <description>&lt;p&gt;This was sparked by a sudden thought.&lt;/p&gt;

&lt;p&gt;First, let's see how &lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise" rel="noopener noreferrer"&gt;MDN&lt;/a&gt; defines Promise. &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;A Promise is a proxy for &lt;strong&gt;a value not necessarily known&lt;/strong&gt; when the promise is created. It allows you to associate handlers with an asynchronous action's eventual success value or failure reason. This lets asynchronous methods return values like synchronous methods: instead of immediately returning the final value, the asynchronous method &lt;strong&gt;returns a promise to supply the value at some point in the future&lt;/strong&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1y1tgsuxdno32ya2yhau.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1y1tgsuxdno32ya2yhau.gif" alt="confused gif" width="480" height="247"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Think of it this way -- you participate in a lucky draw contest which offers a prize of $1000 voucher. You are given a ticket as a record.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;ticketPromise&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Promise&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;luckyDrawProcess&lt;/span&gt;&lt;span class="p"&gt;());&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You really hope that you win this lucky draw so you can buy the newest noise-cancelling headset 🎧 Else... maybe you'll just get an ice-cream to cheer yourself up 🍦&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;ticketPromise&lt;/span&gt;
  &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;then&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;thousandDollarVoucher&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
     &lt;span class="nf"&gt;buyHeadSet&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;thousandDollarVoucher&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;})&lt;/span&gt;
  &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;catch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;lostHope&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;buyIceCream&lt;/span&gt;&lt;span class="p"&gt;());&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Basically, a Promise is an object that &lt;em&gt;promises&lt;/em&gt; you a result in the future. You can pre-determine your actions based on the result you get and whether it is resolved or rejected. &lt;/p&gt;

&lt;p&gt;Promises are more than just this though, and the rest is for you to find out ;)&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>beginners</category>
    </item>
  </channel>
</rss>
