# Mailer.php not working

**URL:** <https://forum.kirupa.com/t/mailer-php-not-working/295697>\
**Category:** Uncategorized\
**Created:** [September 3, 2009, 4:16am UTC](https://forum.kirupa.com/t/mailer-php-not-working/295697 "2009-09-03T04:16:17Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kmei](https://avatars.discourse-cdn.com/v4/letter/k/e9bcb4/32.png) [@kmei](https://forum.kirupa.com/u/kmei)\
**Post date:** [September 3, 2009, 4:16am UTC](https://forum.kirupa.com/t/mailer-php-not-working/295697/1 "2009-09-03T04:16:17Z")

</div>

[FONT=&quot]Hi everyone[/FONT][FONT=&quot],[/FONT][FONT=&quot] I’m a self taught noob, who is still learning and have[/FONT][FONT=&quot] been trying to figure out why my mailer.php file is not working. Well I think that is the problem. Unless I’m completely wrong. Whenever I press the submit button for my contact form it gives me a window with two errors.[/FONT]  
[COLOR=DarkSlateBlue][FONT=&quot]“[/FONT][FONT=&quot]The requested URL /contact/mailer.php was not found on this server.[/FONT][FONT=&quot][/FONT][/COLOR]  
[COLOR=DarkSlateBlue][FONT=&quot]Additionally, a 404 Not Found error was encountered while trying to use an Error[/FONT][FONT=&quot] [/FONT][FONT=&quot]Document to handle the request.[/FONT][/COLOR][FONT=&quot][COLOR=DarkSlateBlue]”[/COLOR][/FONT]  
[FONT=&quot](Also, this is on the page as well.)[/FONT]  
[COLOR=DarkSlateBlue][FONT=&quot]Apache/2 Server Port 80[/FONT][/COLOR][FONT=&quot][COLOR=DarkSlateBlue])[/COLOR][/FONT]  
[FONT=&quot]With this mailer php I found and made subtle changes to it to correspond with the contact form I made, I’m trying to have messages sent from a website to my email. If anyone out there knows what my problem is and could steer me in the right direction. I would be extremely appreciative.[/FONT]  
[FONT=&quot]  
[/FONT]

[FONT=&quot]Contact form code:[/FONT]  
[FONT=&#44404]  
[/FONT]  
[FONT=&#44404]\<form method=“POST” action=“mailer.php”\>[/FONT]  
[FONT=&#44404]\<label for=“Name” id=“Name”\>Name:\</label\>[/FONT]  
[FONT=&#44404] \<input type=“text” name=“Name” /\>[/FONT]  
[FONT=&#44404] [/FONT]  
[FONT=&#44404] \<label for=“Email” id=“Email”\>Email:\</label\>[/FONT]  
[FONT=&#44404] \<input type=“text” name=“Email” /\>[/FONT]  
[FONT=&#44404] [/FONT]  
[FONT=&#44404] \<label for=“Tel” id=“Tel”\>Tel:\</label\>[/FONT]  
[FONT=&#44404] \<input name=“Tel” type=“text” maxlength=“20” /\>[/FONT]  
[FONT=&#44404] [/FONT]  
[FONT=&#44404] \<label for=“Message” id=“Message”\>Message:\</label\>[/FONT]  
[FONT=&#44404] \<textarea name=“Message” rows=“20” cols=“20”\>\</textarea\>[/FONT]  
[FONT=&#44404] \<input type=“submit” name=“Submit” value=“Submit” class=“submit-button” /\>[/FONT]  
[FONT=&#44404] [/FONT][FONT=&#44404]\</form\>[/FONT]

```
 [FONT=&quot]PHP code:[/FONT]

```

[FONT=&#44404]\<?php [/FONT]  
[FONT=&#44404]if(isset($\_POST[‘submit’])) { [/FONT]  
[FONT=&#44404]$to = "myemail@hotmail.com"; [/FONT]  
[FONT=&#44404]$subject = “Form Tutorial”; [/FONT]  
[FONT=&#44404]$name\_field = $\_POST[‘name’]; [/FONT]  
[FONT=&#44404]$email\_field = $\_POST[‘email’];[/FONT]  
[FONT=&#44404]$tel\_field = $\_POST[‘tel’];[/FONT]  
[FONT=&#44404]$message = $\_POST[‘message’]; [/FONT]  
[FONT=&#44404] [/FONT]  
[FONT=&#44404]$body = “From: $name\_field  
E-Mail: $email\_field  
Tel:  
$tel\_field  
Message:  
$message”; [/FONT]  
[FONT=&#44404] [/FONT]  
[FONT=&#44404] [/FONT]  
[FONT=&#44404] echo “Data has been submitted to $to!”; [/FONT]  
[FONT=&#44404]mail($to, $subject, $body); [/FONT]  
[FONT=&#44404]} else { [/FONT]  
[FONT=&#44404]echo “blarg!”; [/FONT]  
[FONT=&#44404]} [/FONT]  
[FONT=&#44404]?\>[/FONT]  
:no\_love:
