Open Side Menu Go to the Top
Register
I need a web base email generator I need a web base email generator

10-01-2008 , 05:08 PM
I need a script for a simple web based email form generator.
I want to put up a simple page where i can send people.
They will be able to fill in a subject line, "from" information, fill in the body of the letter they want to send and click send...
The key is that i want a copy of this email sent to specific email addresses that only i can manipulate( 91 of them specifiably).

Anyone use anything they can recommend?
I need a web base email generator Quote
10-01-2008 , 06:22 PM
You can do this very very easily with a php script.

Example:
http://www.buildwebsite4u.com/advanced/php.shtml
I need a web base email generator Quote
10-01-2008 , 06:37 PM
Quote:
Originally Posted by mmbt0ne
You can do this very very easily with a php script.

Example:
http://www.buildwebsite4u.com/advanced/php.shtml
thanks, messing with it a little, but having issues getting it to work locally...does it need to be uploaded to work?

Ive created a folder in which there are two files, the mail.html and the mail.php , ive paste the code for each in the corresponding file , changing the "to" to a test email.
When i run a test, i get:

Invalid email address"; echo "Back"; } elseif ($subject == "") { echo "
No subject
"; echo "Back"; } /* Sends the mail and outputs the "Thank you" string if the mail is successfully sent, or the error string otherwise. */ elseif (mail($email,$subject,$message)) { echo "
Thank you for sending email
"; } else { echo "
Can't send email to $email
"; } ?>
I need a web base email generator Quote
10-01-2008 , 06:49 PM
Do you have a server running locally on your computer (through something like XAMPP)

That's the only way you'll get it to work locally (that I know of).

Otherwise, yes, you'll need to upload it.
I need a web base email generator Quote
10-01-2008 , 06:52 PM
Also, since you seem to want to hardcode the "to" address and have the user enter the "from" address, this page will be helpful:

http://us3.php.net/manual/en/book.mail.php
http://us3.php.net/manual/en/function.mail.php

<?php

$Name = "Da Duder"; //senders name
$email = "email@adress.com"; //senders e-mail adress
$recipient = "PersonWhoGetsIt@emailadress.com"; //recipient
$mail_body = "The text for the mail..."; //mail body
$subject = "Subject for reviever"; //subject
$header = "From: ". $Name . " <" . $email . ">\r\n"; //optional headerfields

mail($recipient, $subject, $mail_body, $header); //mail command
?>
I need a web base email generator Quote
10-02-2008 , 02:36 PM
I don't know if you ever got anywhere, but I got bored, so here you go:

This will also autosend a basic "Thank You" email to whoever filled out the form. Amend or remove as necessary.

A few notes, this will also require you to create a thanks.html page and an error.html page. Also, there is some very basic error checking in the php file, but not everything. Before you open this up you should really look around for how to validate the email addresses with regular expressions. I had something in there, but it was messing with what g-mail saw (but not Horde for some reason) so I took it out.

mail html site:
Code:
<html>
<head><title>Mail sender</title></head>
<body>
<form action="mail_form.php" method="POST">

<b>From Email</b><br>
<input type="text" name="email" size=40>

<p><b>Subject</b><br>
<input type="text" name="subject" size=40>

<p><b>Message</b><br>
<textarea cols=40 rows=10 name="message"></textarea>

<p><input type="submit" value=" Send ">

</form>
</body>
</html>

PHP backend
Code:
<?php
$BASIC_EMAIL = 'email1@site.com, email2@site.com'; //Change this to whatever you want!!
$BASIC_CONFIRM = 'thanks.html';

$to_email = $BASIC_EMAIL;
$confirmation_page = $BASIC_CONFIRM;
$from_email = $_REQUEST['email'];

$reply_subject = "Thank You";
$email_str_person = "";


#Get and format subject
if(!empty($_REQUEST['subject'])) {
	$email_subject = stripslashes($_REQUEST['subject']);
} else {
	$email_subject = FALSE;
}

#Get and format message
if(!empty($_REQUEST['message'])) {
	$email_str = stripslashes($_REQUEST['message']);
} else {
	$email_str = FALSE;
}

#format email text to person
$email_str_person .= "Thank you for filling out the form.  We will get back to you shortly.\n\n".
					 "Customer Care Team";

#format email header
$text_headers= "MIME-Version: 1.0\r\n".
               "Content-Type: text/plain; charset=iso-8859-1\r\n".
               "From: ".$from_email.
               "Reply-to: ".$from_email."\r\n";

#format email header to requestor
$text_headers_person= "MIME-Version: 1.0\r\n".
               "Content-Type: text/plain; charset=iso-8859-1\r\n".
               "From: customercare@mysite.com\r\n". //Change this to whatever email you want them to see, if any
               "Reply-to: customercare@mysite.com\r\n"; //Change this to whatever email you want them to see, if any
			   
#send email to you
if(mail($to_email, $email_subject, $email_str, $text_headers))
{
  header("Location: $confirmation_page");
}
else
{
  header("Location: /error.html");
}

#send email to requestor
if(mail($from_email, $reply_subject, $email_str_person, $text_headers_person))
{
  header("Location: $confirmation_page");
}
else
{
  header("Location: /error.html");
}

?>
I need a web base email generator Quote
10-02-2008 , 04:53 PM
thanks !
I will try to work with this.
I need a web base email generator Quote

      
m