Computer Forums

Member Login

Remember Me? Sign Up! | Forgot Password
 
Slogan
 
Closed Thread
Old 07-02-2005, 09:29 AM   #1 (permalink)
 
Junior Techie

Join Date: Jun 2005

Posts: 45

wirercx

Default php email form

OK I need a little help with a php email form, if you could help that would be awsome!

Ok so here is the website: http://testsite.broadphase.com/ (it is just a free host that does support PHP that I am just testing on)

So, when you hit the submit a screenshot button it comes up with the form, ok? then when you fill in all the info and hit submit, it does not go to my email. I have my email address set and everything. It will just not go to my G-Mail account.

I guess I should show you the code, here is the sendmail.php:
Code:
<?php
$yourmail = "computewiz98@gmail.com"; // put your e-mail here

$t1 = $_POST['name'];
$t2 = $_POST['mail'];
$t3 = $_POST['comment'];

$data = "This is an automated mail. Someone submited the form and this is what he had to say:\nHis Name: $t1\nHis mail: $t2\nComment: $t3\n";

mail ($yourmail, "screenshot", $data); // The Form mean subject of mail you will receive

die ("Screenshot submited\n");

?>
and here is the form code:
Code:
<form name="form1" method="post" action="sendmail.php">
<table width="99%" border="0" align="center" cellpadding="1" cellspacing="0">
<tr>
<td width="44%"><div align="right">Your Name:</div></td>
<td width="56%"><input name="name" type="text" id="name"></td>
</tr>
<tr>
<td><div align="right">Your E-Mail:</div></td>
<td><input name="mail" type="text" id="mail"></td>
</tr>
</table>
<div align="center">

Comment:



<textarea name="comment" cols="50" rows="6" id="comment"></textarea>




<table width="99%" border="0" cellspacing="0" cellpadding="2">
<tr>
<td>
<div align="right">
<input type="submit" value="Send Form">
</div></td>
<td><input type="reset" name="Submit2" value="Reset Form"></td>
</tr>
</table>
</div>
</form>
Ok once again, if you can help, awsome, if you can't, thats ok

Thanks,
wirercx:o
wirercx is offline  
Old 07-02-2005, 10:38 PM   #2 (permalink)
 
Newb Techie

Join Date: Jul 2005

Posts: 2

phoenix218

Default

I have tried it,it doesn't work.

I think your operation system must have an email program.


phoenix218 is offline  
Old 07-02-2005, 10:48 PM   #3 (permalink)
 
Monster Techie

Join Date: Jul 2003

Posts: 1,179

Emily is on a distinguished road

Send a message via AIM to Emily
Default

I'm not sure why that isn't working... but on web2mail.php on your site the action of the form is set to web2mail.php, not sendmail.php. Is the PHP code all in one file (web2mail.php)?
__________________
<a href=\"http://www.upstark.com\">www.upstark.com</a>
Emily is offline  
Old 07-03-2005, 07:13 AM   #4 (permalink)
 
Junior Techie

Join Date: Jun 2005

Posts: 45

wirercx

Default

OK I have it working now...... I just had to try a different webhost just because the other one didn't seem to support email.


@Emily, I was trying different things at that time
wirercx is offline  
Old 07-04-2005, 01:11 AM   #5 (permalink)
 
Super Techie

Join Date: Apr 2004

Posts: 316

BlazingWolf

Default

You could keep it on the same server, and manually set the outgoing e-mail.

By default it would use whatever the host set for the e-mail server which since it's a free host they probably don't want you using it.

You can set the SMTP server(the outgoing mail server) like this:

ini_set(SMTP, 'mail.mymailserver.com');

You might have to set a few other varibles if your mail server is password protected.
__________________
BlazingWolf
<font color=\'red\'>
<b>
<a href=\'http://www.gaming-forums.org\'>
Gaming-Forums.org
<a/>
</b>
</font>
BlazingWolf is offline  
 
Closed Thread

« nvm | vb wifi »
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On