Jump to content

Recommended Posts

ok i have a php script i want it to send the form data to a email address i try the html form post method but every time it opens outlook express and in the text field where you type the message its has the form data i make it post the form data by mailto:myemail@gmail.com or what ever

 

i think i need a mail script that the php form sends it to the script i cant remember

 

does anyone have a mail script thing that i can use and can you make it send all the form data to the email address ilovecakelots@gmail.com

Thanks

Link to comment
https://forums.phpfreaks.com/topic/55625-help-with-mail-script/
Share on other sites

Google it, or try to make it yourself. Make a form and use POST as method. Than use mail() if you want to keep it simple (or SwiftMailer.org if you want a better sollution or phpmailer). Than fill in the information of the form in the message to send. Not very difficult, but can be hard for a beginner.

 

FD

Link to comment
https://forums.phpfreaks.com/topic/55625-help-with-mail-script/#findComment-274862
Share on other sites

Ok all you need to do is collect the data using POST and then put it into a mail script

 

 

This is just an example from one I used. This relies on you having a mail server set up on your host. If you buy web hosting chances are you will have and it will be all set up ready to go. if you are testing on your local host you can use a program called AGS mail server.

 

http://www.phpeasystep.com/phptu/23.html

 

This is a tutorial on setting up AGS Mail server on your localhost for testing.

 

Anyways the script is

 

$from = 'admin@rotherham-guide.com';
$addy = $email;
$subject = 'Welcome to rotherham-guide.com';
$message = 'The Body of the message goes here'; 

$send = mail($addy, $subject, $message, "From:$from\n" . "MIME-Version:1.0\n" . "Content-type:text/html; charset=iso-8859-1");

Link to comment
https://forums.phpfreaks.com/topic/55625-help-with-mail-script/#findComment-274866
Share on other sites

hey this might help if you are getting variables from a form

 <form method="post" action="sendmail.php">
  Email: <input name="email" type="text" /><br />
  Message:<br />
  <textarea name="message" rows="15" cols="40">
  </textarea><br />
  <input type="submit" />
</form>

 

php code:

 


<?
  $email = $_REQUEST['email'] ;
  $message = $_REQUEST['message'] ;

  mail( "yourname@example.com", "Feedback Form Results",
    $message, "From: $email" );
  header( "Location: http://www.example.com/thankyou.html" );
?>

Link to comment
https://forums.phpfreaks.com/topic/55625-help-with-mail-script/#findComment-274896
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.