• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Form Problems with mailto command???

New Here ,
Dec 14, 2017 Dec 14, 2017

Copy link to clipboard

Copied

I have a form set up that after the user fills in the information and hits the submit button, the form will eMail that info to the admin for that site. I have checked it several ways with the same result: Mac, iPad, and iPhone users have no problem sending the info. PC users have no success at all. I have even followed tutorials step-by-step to be sure I did everything right. From what I see, I did do everything as it should have been done. Is there a "special trick" I need to use to compensate for something in Windows 10? I appreciate any suggestions or ideas. I will send what I have typed upon request if needed.

Thanks,

Rick

Views

2.3K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Dec 14, 2017 Dec 14, 2017

I have posted a 3-part tutorial that you can reference.

Alt-Web Design & Publishing: Responsive Contact Form with Bootstrap 3.2 and PHP (Part 1)

This secure PHP script does several important things:

  • Hides your email address from robot harvesters,
  • Self-validates required input fields,
  • Tests for robot submissions,
  • Sanitizes input fields & thwarts header injections,
  • Gives feedback to users,
  • Sends form data to your email address. 

Nancy

Votes

Translate

Translate
Community Expert ,
Dec 14, 2017 Dec 14, 2017

Copy link to clipboard

Copied

if your end user doesn't have to add anything manually in to the mail body manually, why don't you add a simple PHP script that will handle, in the background, the text formating throught a sendmail() function will send everything...

if you have some easy way to write PHP a phpmailer class Tutorial · PHPMailer/PHPMailer Wiki · GitHub  will be really better than a simple sendmail's function PHP: mail - Manual  ...

in any case it is really simple to be handle, compare to the mailto: protocol... if you're ok I can send you the code, but all the online tutroiel (links above) are really fully explain...

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 14, 2017 Dec 14, 2017

Copy link to clipboard

Copied

I would be very happy to look at it. Thank you.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 14, 2017 Dec 14, 2017

Copy link to clipboard

Copied

ok so the very basic script... say that you have a form containing two fields and a submit button

<form action="sendmail.php" method="post">
    <input name="name" type="text" >
    <input name="email" type="text" >
    <input type="submit">
</form>

then you will add s sendmail.php file that will contain

<?php

    $name = $_POST['name'];

    $mail = $_POST['email'];

    $subject = 'whatever subject that you need';

    $body = 'what ever text';

    $body .= "<br>";

    $body .= 'From: "'.$name.'" - '.$mail.'' . "<br>";

    $body .= $body;

    $adress="mail@domain.ext";

    $header='From: "'.$name.'"<'.$mail.'>' . "\r\n";

    $header .='Reply-To:'.$mail . "\r\n";

    $header .='Content-Type: text/html; charset="utf-8' . "\r\n";

    $header .='Content-Transfer-Encoding: 8bit' . "\r\n";

    $dest = 'pagetogo.html';

    mail($adresse,$sujet,$corps,$entete);

    // if you need uncomment the following line

   // header("Location: " . $dest );

  

?>

that is the very basic one... there is no validation, checkin/out and so on... but  if you need further detail, one can do it... either with a more sofistcated tool as php mailer

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 14, 2017 Dec 14, 2017

Copy link to clipboard

Copied

How on earth is that going to work.

You have adresse instead of adress, sujet instead of subject and what is corps and entete..........and how are the headers being sent?

Some errors there, l think.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 14, 2017 Dec 14, 2017

Copy link to clipboard

Copied

youps in the hurry I forgot to localise all the variable names

adresse = address

entete = header

sujet = subject

corps = body

anyway if you don't get the two words entete and corps... I think that you must be enought smart... or clever, to use the jing translator... and can understand, that it must be one of the two last... body and headers... but I 'm perhaps wrong... arf arf arf !!!!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 14, 2017 Dec 14, 2017

Copy link to clipboard

Copied

as I told you in a previous mail, the sendmail function is very basic and enought unsecure, most provider can lock its use... so it is could for testing and unsertsanding the send mail process... but I will most recommand to use the php mailer class... once you understood how the first one works, give a test to this second one...

Tutorial · PHPMailer/PHPMailer Wiki · GitHub

you can also add the SMTP class and the POP class PHPMailer/src at master · PHPMailer/PHPMailer · GitHub

boths are very usefull... please if you feel unconfurtable using them let us know...

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 14, 2017 Dec 14, 2017

Copy link to clipboard

Copied

LATEST

I have posted a 3-part tutorial that you can reference.

Alt-Web Design & Publishing: Responsive Contact Form with Bootstrap 3.2 and PHP (Part 1)

This secure PHP script does several important things:

  • Hides your email address from robot harvesters,
  • Self-validates required input fields,
  • Tests for robot submissions,
  • Sanitizes input fields & thwarts header injections,
  • Gives feedback to users,
  • Sends form data to your email address. 

Nancy

Nancy O'Shea— Product User, Community Expert & Moderator
Alt-Web Design & Publishing ~ Web : Print : Graphics : Media

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 14, 2017 Dec 14, 2017

Copy link to clipboard

Copied

The mailto: command requires that there is an email client installed on the machine (like Outlook, Mac's Mail, etc). If there is no email client, say the viewer uses Gmail through their browser, hitting Send on a form that uses mailto:email@address will do nothing.

For that reason alone, it's worth never using mailto: in forms and going with a server-side form to email script (PHP for example).

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines