Jump to content

sendmail.php problem


Miks

Recommended Posts

Hi all!!!!

 

I have one problem. Recently, i've developed a html page on which i made this

 

<form method="post" action="sendmail.php">

                  <p><span class="style6 style19">Message:</span></p>

                                <p>

                                  <input name="message" type="text" class="style15" />

                                  Write something

                                                                </p>

                  <p><span class="style6 style19">Email:</span></p>

                                <p>

                                  <input name="email" type="text" class="style15" />

                                Write your email      </p>

              <p align="left"><span class="style6 style19">City</span></p>

                                <p align="left">

                                  <input name="city" type="text" class="style15" />

Write the name of the city                            </p>

 

 

and the problem is on my sendmail.php page which goes like this

 

 

<?php

 

  $email = $_REQUEST['email'] ;

  $message = $_REQUEST['message'] ;

$city = $_REQUEST['city'] ;

 

 

  if (!isset($_REQUEST['email'])) {

    header( "Location: http://www....................." );

  }

  elseif (empty($email) || empty($message) || empty($city) ) {

    header( "Location: http://www......................" );

  }

  else {

    mail( "[email protected]", "Text", $message, $email, $city,

      "From: $email" );

    header( "Location: http://www......................" );

  }

?>

 

the problem is that it will not send this if i state here -> mail( "[email protected]", "Text", $message, $email, $city,

      "From: $email" );

those three bolded,but only if i state message and email....

 

 

where is the logic in that...please i need help.if someone didn't understand i'm willing to explain it better!!!! :-[

Link to comment
https://forums.phpfreaks.com/topic/180205-sendmailphp-problem/
Share on other sites

Maybe its an issue with the way your emai() command is set up. Here is how it should look:

 

mail(to,subject,message,headers,parameters)

 

So if I were to put it together it might look like this:

 

<?php
$to = "[email protected]";
$subject = "Test mail";
$message = "Hello! This is a simple email message.";
$from = "[email protected]";
$headers = "From: $from";
mail($to,$subject,$message,$headers);
?> 

Link to comment
https://forums.phpfreaks.com/topic/180205-sendmailphp-problem/#findComment-950736
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.