Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Email form results as Excel attachment.

Status
Not open for further replies.

Diggum1

Programmer
Oct 14, 2004
67
US
Hello all,

I'd like to email the results of a contact form submission as an Excel attachment. I'm currently using the following (abbreviated):

<?php
@extract($_POST);
$name = stripslashes($name);
$email = stripslashes($email);
$subject = 'Contact Form';
$text = stripslashes($message);

/* Specify your SMTP Server, Port and Valid From Address */
ini_set("SMTP","mail.abc.com");
ini_set("smtp_port","25");
ini_set("sendmail_from","abc@abc.com");


mail('abc@gmail.com',$subject,"Name: $name\nEmail: $email\nComments: \n$message","From: $name <$email>");
echo("Thank you for your interest");
?>

Ideally, on submit, I'd like the 3 form variables (name, email, message) to each have their own column in the Excel file, and be emailed as an attachment.

I've looked around, but can't find anything. Any ideas?

Thanks
Rick
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top