# Sendmail problem

**URL:** <https://forum.kirupa.com/t/sendmail-problem/76588>\
**Category:** programming\
**Created:** [January 19, 2005, 7:22pm UTC](https://forum.kirupa.com/t/sendmail-problem/76588 "2005-01-19T19:22:12Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![imagined](https://avatars.discourse-cdn.com/v4/letter/i/a87d85/32.png) [@imagined](https://forum.kirupa.com/u/imagined)\
**Post date:** [January 19, 2005, 7:22pm UTC](https://forum.kirupa.com/t/sendmail-problem/76588/1 "2005-01-19T19:22:12Z")

</div>

I have this as the form:

```auto

<form action="sendmail.php" method="post" name="subscribeForm" 
id="subscribeForm">
<div style="padding:15;color:717171" class="ver10">

Name:&nbsp;&nbsp;<input type="text" name="name" 
size="16">&nbsp;&nbsp;&nbsp;

Subscribe&nbsp;&nbsp;&nbsp;&nbsp;<input type="radio" value="subscribe" 
checked name="subscribe">
<br><br>

E-mail: &nbsp;<input type="text" name="email" 
size="16">&nbsp;&nbsp;&nbsp;

Unsubscribe<input type="radio" name="subscribe" value="unsubscribe">
<br><br>

<div align="center"><input type="image" border="0" name="submitImage" 
value="submit" src="images/submit.gif"></div>
<br><br> 
Sign up for news and updates! </div>
</form>

```

* * *

THIS IS THE CODE IN THE SENDMAIL.PHP file:

```php

	$name = $_REQUEST['name'];
	$email = $_REQUEST['email'];
	
	if (!empty($subscribe) AND !empty($unsubscribe))
	{
	echo("Please select either Subscribe or Unsubscribe. You cannot select 
both at the same time.");
	}
	
	if(empty($name))
	{
	echo("Please go back and enter your name.");
	die();
	}
	
	if(empty($email))
	{
	echo("Please go back and enter your email.");
	die();
	}
	
	$subs = $_REQUEST['subscribe'];
	$dataSent = 'Name: ' . $name . ' --- Email: ' . $email . ' --- 
Request: ' . $subs;
  mail( "chafasite@yahoo.com", "Betheltrips.com Subscribe-Unsubscribe 
Contact Form", $dataSent, "From: $name" );
  header( "Location: 
http://www.betheltrips.com/wFlash/confirmation.php" );

```

* * *

THIS IS THE ERROR I GET ON THE BROWSER:

Warning: mail(): “sendmail\_from” not set in php.ini or custom “From:”  
header missing in C:\Apache2\htdocs\betheltrips\wFlash\sendmail.php on  
line 24

Warning: Cannot modify header information - headers already sent by  
(output started at C:\Apache2\htdocs\betheltrips\wFlash\sendmail.php:24)  
in C:\Apache2\htdocs\betheltrips\wFlash\sendmail.php on line 25

What am I doing wrong? The From in the header is set on the script.  
Please help. [hair]

Thanks in advance,

Leo
