Menu icon Foundation
Form submit

I want do submit the integrated Form of Foundation. No problem (thanks to Wing-Hou Chan).
But I want a few special features.

1) The mail field should be the sender mail address. e.g. when someone type in "jonas@gmail.com" the sender address in my mail program should be the same.

2) I want to send the sender an automatic reply that his message has arrived.

I hope you guys can help me! Oh, and sorry for my bad language, I'm from Germany.

Thank you!

<!-- At the moment I use this kind of code -->

<?php 
  $to = 'info@predatordesign.de' ;
  $subject = $_POST['subject'] ; 
  $name = $_POST['name'] ; 
  $message = $_POST['message'] ;

  $message = "From: $name \nMessage: $message \n";

  $sent = mail($to, $subject, $message) ; 
    if($sent) {
      echo "<h3>Thank you for your message.</h3><p>Your email has been sent successfully and we appreciate you getting in touch with us. We will be sending a reply soon.</p>"; 
    }else{
      echo "<h3>Sorry, your message wasn't sent.</h3><p>We seem to have encountered a problem sending your message. Please go back and try again. If you get this message again please email <a href='mailto:webmaster@yourDomain.com'>webmaster@yourDomain.com</a>.</p>"; 
}

?>

         

forsubmitfeaturesnewspecialsend

I want do submit the integrated Form of Foundation. No problem (thanks to Wing-Hou Chan).
But I want a few special features.

1) The mail field should be the sender mail address. e.g. when someone type in "jonas@gmail.com" the sender address in my mail program should be the same.

2) I want to send the sender an automatic reply that his message has arrived.

I hope you guys can help me! Oh, and sorry for my bad language, I'm from Germany.

Thank you!

<!-- At the moment I use this kind of code -->

<?php 
  $to = 'info@predatordesign.de' ;
  $subject = $_POST['subject'] ; 
  $name = $_POST['name'] ; 
  $message = $_POST['message'] ;

  $message = "From: $name \nMessage: $message \n";

  $sent = mail($to, $subject, $message) ; 
    if($sent) {
      echo "<h3>Thank you for your message.</h3><p>Your email has been sent successfully and we appreciate you getting in touch with us. We will be sending a reply soon.</p>"; 
    }else{
      echo "<h3>Sorry, your message wasn't sent.</h3><p>We seem to have encountered a problem sending your message. Please go back and try again. If you get this message again please email <a href='mailto:webmaster@yourDomain.com'>webmaster@yourDomain.com</a>.</p>"; 
}

?>

         

This post has been closed. No new replies can be added.

Wing-Hou Chan over 5 years ago

Hey Jonas!

Thanks for the thanks! I guess it should be "Your welcome", but hey.

Forgive me, I'm not quite understanding what you want in your first point. Are you wanting an input where the user inputs their email address?

As for the second point. There are ways of interpreting this:

1) We can send the confirmation email if $sent returns true. The benefit of this is it shouldn't be too hard to implement. We just need a little more PHP and we're set. The downside is that the confirmation email will still be sent even if you don't actually get the email. After all there may be a problem between the PHP echoing the success message and you actually receiving the email.

2) We can send the confirmation email upon confirmation that your email service has actually received the email. The benefit of this is the sender will receive the confirmation email upon you receiving their message. The downside is that you will need to work something out with either your email service provider or email client.