Jump to content


Photo

sending mail


  • Please log in to reply
2 replies to this topic

#1 MrBurn

MrBurn
  • New Members
  • Pip
  • Newbie
  • 1 posts

Posted 29 April 2005 - 10:44 AM

Hi all thats are reading this! i have abig question. It's posible to send a mail from an inbox mail. Example: I send a mail to a friend with a field text in page and a submit button. Can I receive the text from that text fielc in mai email? And how can i do it.
Thanks and excuse for my english.

#2 djwave28

djwave28
  • New Members
  • Pip
  • Newbie
  • 1 posts

Posted 06 May 2005 - 06:46 PM

Hi all thats are reading this! i have abig question. It's posible to send a mail from an inbox mail. Example: I send a mail to a friend with a field text in page and a submit button. Can I receive the text from that text fielc in mai email? And how can i do it.
Thanks and excuse for my english.

View Post


Hey,

I have a simple answer. I have used the script from this site and rebuild it a bit to my own liking, but it works great. It can send a mail to the administrator and one to the address filled in. So you can see two types of asending mail. To a fixed email address and to the one entered.

See this link: http://www.ibdhost.com/contact/

#3 Pilot-Doofy

Pilot-Doofy
  • Members
  • PipPip
  • Member
  • 19 posts
  • LocationMustywindows.com!

Posted 29 May 2005 - 06:47 PM

Hey,

I have a simple answer. I have used the script from this site and rebuild it a bit to my own liking, but it works great. It can send a mail to the administrator and one to the address filled in. So you can see two types of asending mail. To a fixed email address and to the one entered.

See this link: http://www.ibdhost.com/contact/

View Post


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR...ml4/loose.dtd">
<html>
<head>
<title>Email Contact Form</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
<?php

$master = 'your_email@domain.com';
## Edit this line to include your email
## between the single quotes

error_reporting(ALL);

if (!isset($_POST['Submit'])) {
echo '<form action="' . $HTTP_SERVER_VARS['PHP_SELF'] . '" method="post" name="email_form" id="email_form">
<table width="100%" border="0" cellspacing="0">
<tr>
<td width="22%">Your Name: </td>
<td width="78%"><input name="name" type="text" id="name" size="30"></td>
</tr>
<tr>
<td>Email Subject:</td>
<td><input name="subject" type="text" id="subject" size="40"></td>
</td>
<tr>
<td>Email to Send to: </td>
<td><input name="to" type="text" id="to" size="40"></td>
</tr>
<tr>
<td>Email Body: </td>
<td><textarea name="body" cols="35" rows="6" id="body"></textarea></td>
</tr>
<tr>
<td>Email to Send from: </td>
<td><input name="from" type="text" id="from" size="40"></td>
</tr>
<tr>
<td>Submit Email: </td>
<td><input type="submit" name="Submit" value="SEND EMAIL!"></td>
</tr>
</table>
</form>';
} else { # Submitted the form

$name = $_POST['name'];
$from = $_POST['from'];
$body = $_POST['body'];
$to = $_POST['to'];
$subject = $_POST['subject'];


if (!isset($_POST['to'])) {
$error = true;
$msg = 'Error: You must specify an address to send the email to.';
} if (!isset($_POST['body'])) {
$error = true;
$msg = 'Error: You must specify a body for the email.';
} if (!isset($_POST['name'])) {
$name = 'anonymous';
} if (!isset($_POST['from'])) {
$from = 'nowhere@site.com';
} if (!isset($_POST['subject'])) {
$subject = '(no subject)';
}

$body .= "\n";
$body .= '(This email was sent from ' . $name . ' at ' . $from . ') -- Note: This email was sent via an automated form and this information may not be correct.';

if ($error === true) {
echo $msg;
exit;
} else { # No errors

$send_mail = mail($to, $subject, $body, "From: $from\nX-Mailer: PHP/ . $phpversion()", "-f $from");
$send_mail_two = mail($master, $subject, $body, "From: $from\nX-Mailer: PHP/ . $phpversion()", "-f $from");

if (!$send_mail) {
$msg = 'Error: Email could not be sent at this time.';
} else {
$msg = 'Success! Email was sent.';
}

} // End else for if ($error === true)

echo $msg;

} // End else for if (!isset($_POST['Submit']))

?>
</body>
</html>




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users