1

I have a Landing Page with a contact form. When someone fill my contact form, it sends an email by php mail(). We track with analytics and all the contacts they’re been registered in a database.

Some users, fill the contact form and appears in analytics and in the database, but the mail it’s not sent. We figure out that those ones are coming from iPhone and tablet users. We try to mix the headers with PHP_EOL, \r \n, \nand still not working. We try as well to add Content-Transfer-Encoding: quoted-printable, but nothing.

I use this form:

 <form id="contact" method="post" action="thanks.php">

and the ajax is:

$("#contact").submit(function() {
    $.ajax({
        type : "POST",
        url : "send_mail.php",
        dataType : "html",
        data : $(this).serialize(),
        beforeSend : function() {
            $("#loading").show();
        },
        success : function(response) {
            $(location).attr('href', 'http://myurl.com/thanks.php');
            $("#response").html(response);
            $("#loading").hide();
        }
    })
});

In my thanks.php I have the insert to my Data Base.

Could somebody help me? thanks!!!

gofr1
  • 15,741
  • 11
  • 42
  • 52
  • Consider using PHPMailer or similar instead of the standard PHP `mail()` function. Also, see this post: [PHP mail form doesn't complete sending e-mail](http://stackoverflow.com/questions/24644436/php-mail-form-doesnt-complete-sending-e-mail) – Qirel Jan 21 '16 at 11:07
  • 1
    Since php is a server side language the problem should not be caused the client, ie the mobile browser, if you're not sending anything client specific via the form. – Nicklas Ridewing Jan 21 '16 at 11:22
  • Thanks for your answers, anyway the problem it’s not in the browser and neither in the contact form, it send the email from Pc, and from android, the problem it’s just with iphone and ipad. thanks – Albert Marimón Torres Jan 21 '16 at 11:56
  • @Albert The comment above states that since PHP is a *server-side* language, it does not matter on which device or operating system the client is sending the request from. Take a look at the link I posted in my first comment, too. – Qirel Jan 21 '16 at 15:08
  • Hi @Qirel, I Took a look at the link, but I couldn't solve my issues. I use ajax for make a redirection to my thanks.php(Where I have the track code and integration with BBDD) and at the same time, this ajax call to the send_mail.php. Maybe there are some error is in this ajax, but I cant fix it. – Albert Marimón Torres Jan 25 '16 at 09:40
  • What is your PHP code for "thanks.php"? Could you add it to your post? – Anastasia Sitnina Mar 10 '16 at 13:45

0 Answers0