I am trying to put together an email form that will
allow visitors to a site to attach image files to the message and
then send the whole thing to me. I know I can provide a link to
their Outlook for this but I really want it all to happen from
within the site.
Any help would be appreciated.
Hi Forrest,
Could you tell me where I'm going wrong with this form.
All the php code appears at the top of the page above the
form, I've tried saving the page as a .php page but that wouldn't
preview in the browser. I'm sure this a perfectly simple thing to
solve but I can't work it out.
A
Anonymous
September 7, 2006
i would leave the libmail code as is. it is worth taking some
time to learn their object model. to send all of the messages to
the same address (a good idea, that is the way it was set up...you
dont want spammers using your server) remove the form input, and
change this line of the code:
$m->To($_POST['recipient']);
to
$m->To('your email address here');
A
Anonymous
September 10, 2006
Hi I am looking for something like this except that instead
of writing an email address as me@myplace.com I have a CV listing
that I keep private by using a 'Contact Me' instead of the
me@myplace.com link and then use a go to detail link to take to a
contact form. So what I am asking is there a way to have the email
sent to this person - me@myplace.com using the <?php echo
$row_detailrs2['contactemail']; ?> or do I have to use $_POST?
The recordset shows the data email through using
$_GET['contactemail'], so to echo it will actually show the data
for me.
I have everything working up until now.
Thanks hope you understand.
Theresa
A
Anonymous
September 10, 2006
you can use any method you want to set the recipient of the
emails. i prefer to use post variables, as it is more secure. there
is less chance of a spammer getting ahold of your form and spamming
from your server. you could also get this address from the database
or hard code a recipient in.
A
Anonymous
September 6, 2006
Hi,
I use this class to send html emails with attachments:
Thanks for the link. I don't know anything about php but I'll
get the book out and see if I can make some sense of it.
A
Anonymous
September 6, 2006
try this form. download the libmail class, and put the file
in the same directory that you have the form in.
<?php
if(isset($_POST['submit'])){
//upload the attached file
include "libmail.php";
$m= new Mail; // create the mail
$m->From($_POST['email']);
$m->To($_POST['recipient']);
$m->Subject($_POST['subject']);
$m->Body($_POST['message']); // set the body
//$m->Cc( "someone@somewhere.fr");
//$m->Bcc( "someoneelse@somewhere.fr");
$m->Priority(4) ; // set the priority to Low
if(is_uploaded_file($_FILES['file_attachment']['tmp_name'])){
move_uploaded_file($_FILES['file_attachment']['tmp_name'],
basename($_FILES['file_attachment']['name']));
$m->Attach($_FILES['file_attachment']['name']) ; //
attach a file
}