CodeCharge Studio
search Register Login  

Visual Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 Sending an email attachment

Print topic Send  topic

Author Message
hanso

Posts: 1
Posted: 07/27/2007, 8:04 AM

Hello everybody....

Im pretty new with PHP.

I got a code to send a form using PHP and FLASH, which it send a message to the person who filled up the form. Well I would like to include a PDF file as an attachment to that message.
How can I do that?

this is the PHP code that Im using: Thanks in advanced

<?

function parse($valeur){
return stripslashes(nl2br(utf8_decode($valeur)));
}

$sujetmsg = parse($_POST['sujet']);
$firstName_txt = parse($_POST['firstName']);
$lastName_txt = parse($_POST['lastName']);
$company_txt = parse($_POST['company']);
$address_txt = parse($_POST['address']);
$city_txt = parse($_POST['city']);
$state_txt = parse($_POST['state']);
$zipcode_txt = parse($_POST['zipcode']);
$phone_txt = parse($_POST['phone']);
$fax_txt = parse($_POST['fax']);
$mail_txt = parse($_POST['mail']);
$username_txt = parse($_POST['username']);
$password_txt = parse($_POST['password']);
$confirmPassword_txt = parse($_POST['confirmPassword']);

$contentmsg = "<b>First Name: </b>".$firstName_txt."<b><br />Last Name: </b>".$lastName_txt."<b><br />Company Name: </b>".$company_txt."<b><br />Address: </b>".$address_txt."<b><br />City: </b>".$city_txt."<b><br />State: </b>".$state_txt."<b><br />Zip Code: </b>".$zipcode_txt."<b><br />Phone Number: </b>".$phone_txt."<b><br />Fax Number: </b>".$fax_txt."<b><br />E-Mail: </b>".$mail_txt."<b><br /><br />Desired Username: </b>".$username_txt."<b><br />Create Password: </b>".$password_txt."<b><br />Confirm Password: </b>".$confirmPassword_txt;

$sreception = "Your Registration with Hans Alanis Loan Processing";
$creception = "Thank you for signing up with Hans Alanis Loan Processing.<br><br>Thank You.";

$email="mail@hansalanis.com"; //Change the mail here
$sujet="New Registration From Your Website : ".$sujetmsg." ";
$headers = "MIME-Version: 1.0\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\n";
$headers .= "From: ".$mail_txt."\n";

$headers2 = "MIME-Version: 1.0\n";
$headers2 .= "Content-type: text/html; charset=iso-8859-1\n";
$headers2 .= "From: ".$email."\n";

mail($email,$sujet,$contentmsg,$headers);
mail($mail,$sreception,$creception,$headers2);

?>
View profile  Send private message
greywire


Posts: 37
Posted: 07/31/2007, 11:58 AM

forget using mail(), it sucks. Check out: http://www.swiftmailer.org/


_________________
--
Aric Caley
Fonality, inc
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.