ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

Main Area and Open Discussion > General Software Discussion

How to create a web FORM, with several questions, and get back email replies?

<< < (2/2)

OptimalDesigns:
If you're going to be doing this often, MachForm might be worth the investment for you.  I got it years ago, and still use it.

https://www.machform.com/
-wraith808 (July 08, 2020, 02:27 PM)
--- End quote ---

Can one upload/import an html form?  Here is a link to my form ... https://goal-driven.net/misc/zoom-math-classes.html .  I sent their support team a question on this import question, not sure when they'll get back to me.

Thanks for the lead!

wraith808:
I've only ever used it to create forms from scratch in the application.

Shades:
A crude, yet simple solution:


--- ---<p>Getting more information for class subject A, send a mail message using this <a href="mailto:youraddress@yourdomain.com?subject=Class%20subject%20A%20interest&amp;body=I,%20<sender;s%20name>%20have%20an%20interest%20in%2the%20following:%0AClass%20subject%20A%0A%0AKind%20regards,%0A<sender%20name>%0A">link</a>.</p>
<p>Getting more information for class subject B, send a mail message using this <a href="mailto:youraddress@yourdomain.com?subject=Class%20subject%20B%20interest&amp;body=I,%20<sender;s%20name>%20have%20an%20interest%20in%2the%20following:%0AClass%20subject%20B%0A%0AKind%20regards,%0A<sender%20name>%0A">link</a>.</p>
<p>Getting more information for class subject C, send a mail message using this <a href="mailto:youraddress@yourdomain.com?subject=Class%20subject%20C%20interest&amp;body=I,%20<sender;s%20name>%20have%20an%20interest%20in%2the%20following:%0AClass%20subject%20C%0A%0AKind%20regards,%0A<sender%20name>%0A">link</a>.</p>

<p>It is also possible to send a similar request by post using our <a href="www.yourdomain.com/contact"><strong>contact form</strong></a> or by using the telephone number(s) listed in the form.</p>
If people have a (properly configured) mail client on their system, they will see a new screen appear with all the required information already filled into the receivers address, the subject and the body of the message. The only thing the prospect needs to do is clicking on the 'Send' button of their respective mail client. If they have configured gmail or other online mail client, that should result in a new browser tab to their online mail account with the same message content already pre-filled.

Creating a message with an automated subject line and/or mail address are easy to filter in your own mail client (workable if attendance numbers are low) or mail processor (if attendance numbers are high). Most mail clients have features that can automate responses, if you wish to send the prospect a confirmation mail of any kind.

As stated earlier, it is a crude solution and only really viable for a low amount of classes in the current format. But you can alter the message content, etc. as you please.

This solution also does not take into account users that have an improperly configured mail client or no mail client at all on their system. Something to consider as well.

OptimalDesigns:
But, where is the logic to decide which checkboxes are checked?

Here is some php code I'm working on ...

--- ---<?php

if(isset($_POST['submit'&#93;) ){
  if( empty($username) | empty($email) ) {
    print "Please go back and make sure that 'Name' and 'Email Address' fields have been filled out.";
    return false;
    }

use PHPMailer\PHPMailer\PHPMailer;
include_once "PHPMailer/PHPMailer.php";
include_once "PHPMailer/Exception.php";

// Define email variables
    $mail->To = "Classes <opt-designs&#64;goal-driven.net>";
    $amail  = $_POST['username'&#93;."<".$_POST['email'&#93;.">";
    $mail->Headers = "From&#58;".$amail."\r\n";
//    $mail->Headers .= 'Content-type&#58; text/html; charset=UTF-8';
    $mail->isHTML(true);
    $mail->Body = " "; 

  $classes = $_POST['interest'&#93;;
  if(empty($classes)) {
    echo("You didn't select any check boxes.");
    print "Please go back and make sure that at least one check box has been checked.";
    return false;
  }
  else 
  {
    foreach ($classes as $value) {
      echo($value . " ");     // testing!  $value="oil" ?
      $mail->Subject = $value;
      send1();
     }
   }
  clearAddresses();
}
<script>
function send1()
   $mail->send();
// Sending Email 
  if( send() ) {
    print "Thank you, once 10+ sign-up for each topic, I will get back to you with a date and time for each class.<br>";
    return true;
    }
    else {
      print "An error occurred and your message could not be sent.";
      return false;
    }
</script>

I'm new at PHP so need help here.  Following is one check box

--- ---        <input type="checkbox" id="oil" name="interest[]" value="oil">
        <label for="oil">Oil Refinery Optimization</label>

Navigation

[0] Message Index

[*] Previous page

Go to full version