# Php mail question? I NEED HELP

**URL:** <https://forum.kirupa.com/t/php-mail-question-i-need-help/189857>\
**Category:** Uncategorized\
**Created:** [June 6, 2006, 7:01pm UTC](https://forum.kirupa.com/t/php-mail-question-i-need-help/189857 "2006-06-06T19:01:16Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![selective](https://avatars.discourse-cdn.com/v4/letter/s/4491bb/32.png) [@selective](https://forum.kirupa.com/u/selective)\
**Post date:** [June 6, 2006, 7:01pm UTC](https://forum.kirupa.com/t/php-mail-question-i-need-help/189857/1 "2006-06-06T19:01:16Z")

</div>

I already started this topic in a myspace web and graphic forum,  
please click the link below to visit the forum…

[http://groups.myspace.com/ddesign](mailto:http://groups.myspace.com/ddesign)

and do a search for my topic ( php mail question )

the problem, it’s kind of complicated…

I can respond to this forum or that one, post on either… Thanks

btw, this forum won’t let me copy and paste… that’s why I chose to just put up a link to the other forum.

---

<div class="post-metadata">

**Author:** ![JoshuaJonah](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/joshuajonah/32/1775_2.png) [@JoshuaJonah](https://forum.kirupa.com/u/JoshuaJonah)\
**Post date:** [June 6, 2006, 7:09pm UTC](https://forum.kirupa.com/t/php-mail-question-i-need-help/189857/2 "2006-06-06T19:09:53Z")

</div>

nice promotion of your myspace, almost worked

---

<div class="post-metadata">

**Author:** ![selective](https://avatars.discourse-cdn.com/v4/letter/s/4491bb/32.png) [@selective](https://forum.kirupa.com/u/selective)\
**Post date:** [June 6, 2006, 7:31pm UTC](https://forum.kirupa.com/t/php-mail-question-i-need-help/189857/3 "2006-06-06T19:31:09Z")

</div>

It’s not my group! I don’t care about myspace

What I want is help for a script which I found on [www.kirupa.com](http://www.kirupa.com) …

---

<div class="post-metadata">

**Author:** ![JoshuaJonah](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/joshuajonah/32/1775_2.png) [@JoshuaJonah](https://forum.kirupa.com/u/JoshuaJonah)\
**Post date:** [June 6, 2006, 7:53pm UTC](https://forum.kirupa.com/t/php-mail-question-i-need-help/189857/4 "2006-06-06T19:53:23Z")

</div>

well, you already received the anser from another user, i just send it separately like this:

```php
<?php 
$to = "josh@joshuajonah.com"; 
$subject = $_POST['subject']; 
$name_field = $_POST['name']; 
$email_field = $_POST['email']; 
$message = $_POST['message']; 
if ($email_field == ""){
   $email_field = "No address given.";
};
$headers = 'From:'.$email_field . "
" .'Reply-To: '.$email_field . "
" . 'X-Mailer: PHP/' . phpversion();
$body = "From: $name_field
 E-Mail: $email_field
 Message:
 $message"; 
mail($to, $subject, $body, $headers); 
?> 

```

---

<div class="post-metadata">

**Author:** ![selective](https://avatars.discourse-cdn.com/v4/letter/s/4491bb/32.png) [@selective](https://forum.kirupa.com/u/selective)\
**Post date:** [June 6, 2006, 7:57pm UTC](https://forum.kirupa.com/t/php-mail-question-i-need-help/189857/5 "2006-06-06T19:57:36Z")

</div>

Fine, I’ll sit here and retype it for you lazzy \*\*\*\*\*…

* * *

I just made a form using html and javascript, and I got this php script to work with it but I’m still trying to work out a few bugs. The below script is fine, except that when the mail goes to the two people, it shows up in their inbox as "webmaster@mywebsite.com" instead of “From: $sender\_email” like it did when I first installed the script. Did I change or delete something by mistake? How do I get it to say “$sender\_email” instead of "webmaster@mywebsite.com" ???

I know I still need to figure out a spam protection for this script, I’ll figure this out later. At the moment, the form does have a fields check script on it to make sure all questions are answered.

Below is the script I’m having trouble with…

\<?

$to = “$recipient\_email”;  
$from = “$sender\_email”;  
$subject = “$subject”;  
$body = "$sender\_name did this check list for you  
and would like you to do one for them. Afterreviewing their answers,  
click the link at the bottom of this e-mail

$message

";

if(submit)  
{  
mail($sender\_email, $subject, $subject, $body,“  
You Sent A Copy To: “.$recipient\_name.”\<”.$recipient\_email."\>");  
}  
{  
mail($recipient\_email, $subject, $subject, $body.“  
From: “.$sender\_name.”\<”.$sender\_email."\>");  
}  
?\>

---

<div class="post-metadata">

**Author:** ![selective](https://avatars.discourse-cdn.com/v4/letter/s/4491bb/32.png) [@selective](https://forum.kirupa.com/u/selective)\
**Post date:** [June 6, 2006, 8:26pm UTC](https://forum.kirupa.com/t/php-mail-question-i-need-help/189857/6 "2006-06-06T20:26:23Z")

</div>

None of that stuff worked…

I don’t think any one understands…

Not the SUBJECT area of an e-mail inbox!!!

That’s not what I’m trying to do.

I want to change the SENDER area of an e-mail inbox!!!

So I control what goes in the SENDER area, not the SUBJECT area!!!
