Sendmail path in the mail() function

In the following pair of scripts, is the sendmail path configured properly? On my web host’s server my actual sendmail path is:

/usr/sbin/sendmail/

Do I need to specify the path?


<?php
if (isset($mailnow)){ //if the user wants to mail the page
$to=$email;
$subject="$yourname has sent you a web page";
$message="Dear $name, <br><br>$message<br><br>Take a look at this web page <br><br>$URL<br><br>$yourname";
$servername="mydomain.com";
$parameters="From: $yourname\\r\
"
    ."Reply-To: webmaster@$servername\\r\
"
    ."sendmail:/usr/sbin/sendmail/";

mail ($to, $subject, $message,$parameters );

}
?>

<?php
if (isset($mailpage)): //if the user wants to mail the page
?>
<form action="<?=$PHP_SELF?>" method="post">
  <p>Enter your name:<input type="text" name="yourname" size="40"></p><br>
  <p>Enter your friend's name:<input type="text" name="name" size="40"></p><br>
  <p>Enter your friend's e-mail address:<input type="text" name="email" size="40"></p><br>
  <p>Enter a note to send along with the page:<br>
    <textarea cols="40" rows="10" name="message" wrap></textarea>
  </p>

    <input type="hidden" name="URL" value="URL"><br>
    <input type="submit" name="submit_tip" value="mailnow">
  </p>
</form>

<?php
//the link for the user to send mail with
?>
<a href="email.php"?URL=<?=$PHP_SELF?>>Send this page to a friend</a>
 

TIA

p;)

See other thread in PHP it is set in the php.ini the function mail() comes complete :smiley:

let me borrow your thread ok philips?? :slight_smile:

i was also making a form mailer from my site and i noticed that even thought i included “Reply-to: email@mymail.com”, the received email only included somthing like “email@users.sourceforge.net”…

my site is hosted on sourceforge so i guess that’s why it appended the “@users.sourceforge.net” is there anyway for the actual address to appear??

The form gets sent, but the URL is not included in the message. It is just blank!

Here is the link that connects to the email form page:

<a href=“email.php?URL=<?$PHP_SELF?>”>send this page to a friend </a>

Any ideas?
:confused:

okay girls and boys …

we are gonna take a little field trip :smiley:

First stop PHP website

http://www.php.net/manual/en/function.mail.php

Here we can see the proper way to work with the mail() function in php…

As you can see the $parameters (as philip calls them) I prefer $header since it is the mail header… is optional and can contain header info like from: reply-to: etcetc (read the function at php!!)

next stop Sitepoint.com articles :bouncy2:
http://www.promotionbase.com/article/571
http://www.promotionbase.com/article/572

Here you can see that you can have the “power” of HTML in your email… (if you really want to)

Well… I think thats enough travelling for now…

Greets

Peanuts