Click to See Complete Forum and Search --> : email sender
lastrezort
02-27-2003, 06:00 PM
Hi yall...
In html, I need to know how to affect a form so that the form will send an email to somebody without opening outlook to send the email... I've got my variables set but just don't know how the email sending script should look like... Any examples out there???
So you guys can understand:
I've got a form with a button that sends the info to a script which sends an email with these variables (sender's e-mail address, name, etc...) so I can receive this email with all fields correctly in place so I can do a follow up of his email...
Understand???
qball
02-27-2003, 08:53 PM
In html, I need to know how to affect a form so that the form will send an email to somebody without opening outlook to send the email
HTML can't do this alone...
I've got a form with a button that sends the info to a script which sends an email with these variables (sender's e-mail address, name, etc...) so I can receive this email with all fields correctly in place so I can do a follow up of his email...
what's the script written in? and what is the problem with the script?
lastrezort
02-27-2003, 08:57 PM
I don't know in what the original script is writen in... The problem is that it's a page that was hosted somewhere that treated my problem automatically. We aren't hosted on that site anymore but we want to keep the fonctionnality on our current host and they don't offer the service...
I'd like to write the script in php (I'm good in that!) but don't know how!
please help!
:t
Jay7779
02-28-2003, 12:44 AM
take a look here: http://www.php.net/manual/en/function.mail.php
I've got a perfect PHP form for you. I have one that sends out a single e-mail. Then I have one for you if you want to send out mass e-mails to the same person. I have used it when somebody made me mad.:D
Here is the mass e-mail script:
<html>
<head>
<title>Mail Test</title>
</head>
<body>
<div align="center">
<form action="<?php echo $PHP_SELF; ?>" method="POST">
<table width="650" cellspacing="1">
<tr>
<td>
Who shall i e-mail?
</td>
<td>
<input type="text" name="name" value="<?php echo $HTTP_POST_VARS['name']; ?>">
</td>
</tr>
<tr>
<td>
What is the subject?
</td>
<td>
<input type="text" name="title" value="<?php echo $HTTP_POST_VARS['title']; ?>">
</td>
</tr>
<tr>
<td>
What is the message?
</td>
<td valign="top">
<textarea rows="30" cols="30" name="message"><?php echo $HTTP_POST_VARS['message']; ?></textarea>
</td>
</tr>
<tr>
<td>
</td>
<td>
<input type="Submit" name="Submit" value="E-mail Now">
</td>
</tr>
</form>
</div>
<?php
while (!empty($HTTP_POST_VARS['name']))
mail($HTTP_POST_VARS['name'], $HTTP_POST_VARS['title'], $HTTP_POST_VARS['message'])
?>
</body>
</html>
Here is the single e-mail script:
<html>
<head>
<title>Mail Test</title>
</head>
<body>
<form action="<?php echo $PHP_SELF; ?>" method="POST">
<table width="650" cellspacing="1">
<tr>
<td>
Who shall i e-mail?
</td>
<td>
<input type="text" name="name" value="<?php echo $HTTP_POST_VARS['name']; ?>">
</td>
</tr>
<tr>
<td>
What is the subject?
</td>
<td>
<input type="text" name="title" value="<?php echo $HTTP_POST_VARS['title']; ?>">
</td>
</tr>
<tr>
<td>
What is the message?
</td>
<td valign="top">
<textarea rows="30" cols="30" name="message"><?php echo $HTTP_POST_VARS['message']; ?></textarea>
</td>
</tr>
<tr>
<td>
</td>
<td>
<input type="Submit" name="Submit" value="E-mail Now">
</td>
</tr>
</table>
</form>
<?php
if ($HTTP_POST_VARS['name'])
mail($HTTP_POST_VARS['name'], $HTTP_POST_VARS['title'], $HTTP_POST_VARS['message'])
?>
</body>
</html>
I hope this is what you are looking for. The e-mail address that it says it says that it is from is the one you define in php.ini. :t
SysOpt.com
Copyright Internet.com Inc. All Rights Reserved.