0

I need some direction on the following:

I developed a contact form using AngularJS and PHP. I am hosting the website on GoDaddy. When I access the website on a computer and send a message from the contact form to the specified email address, it works fine; I receive the email. However, if I access the website from a mobile device and use the contact form to send an email, the email is never received. Below is my code.

<?php
$contactFormData = file_get_contents( 'php://input' );
$data = json_decode($contactFormData);
if ($data) {
    $sendername = $data->contactname;
    $sendersubject = $data->subject;
    $senderemail = $data->email;
    $message = $data->message;

    if ( $sendername != '') {
        $mailTo = 'contact@me.com';
        $subject = 'New contact form submission';
        $body  .= 'From: ' . $sendername . "\n";
        $body  .= 'Subject: ' . $sendersubject . "\n";
        $body .= 'Email: ' . $senderemail . "\n";
        $body .= "Message:\n" . $message . "\n\n";

        $sent = mail( $mailTo, $subject, $body );

    }
}
?>
  • Are you accessing the page on a browser of the phone? If so there should be no difference. – Cesar Bielich Feb 16 '18 at 00:06
  • Possible duplicate of [PHP mail function doesn't complete sending of e-mail](https://stackoverflow.com/questions/24644436/php-mail-function-doesnt-complete-sending-of-e-mail) –  Feb 16 '18 at 00:16

0 Answers0