Home

Forums

Web development

 

 

 

 
     
 
dna88 Web development and Technology Forum
 
Profile   Register   Memberlist   Usergroups   FAQ   Search  Log in
how do i attach an email to a php form

 
Post new topic   Reply to topic    dna88 Forum Index -> Web scripting language Discussion Forum
Author Message
buzzby
Just In
Just In


Joined: 22 Sep 2004
Posts: 7

Post Post subject: how do i attach an email to a php form Reply with quote

i have this script
Code:
mail($to, $subject, $msg, $additional_headers);
culminating into this:
Code:
mail('support@building-doctors.com','Contact Us Form','Hello Alex, you need to check your records as '.$_POST['name'].' whose email address is '.$_POST['email'].' has filled out the form. ', "From: webmaster@buildingdoctors.co.uk");


how do i now attach a file to i as an attachment
Thu Sep 23, 04 2:28 am
Back to top
buzzby View user's profile Send private message
quantum
Site Admin
Site Admin


Joined: 07 Mar 2004
Posts: 1048
Location: Dhaka, Bangladesh

Post Post subject: Email script with attachment feature Reply with quote

Buzzby, you need to post the entire script. We cannot solve it from two lines.

Another solution is you can install a new webmail in your site.

Openwebmail is an open source web mail written in php script. It has all the features of a standard email program, including the attachment feature. Take a look into it.

[http://www.openwebmail.org/]

If you want to fix the exisiting script, post the entire script. Or you downloaded it from somewhere give us the URL.

//Topic moved to appropiate forum
_________________

Dust fills my eyes / Clouds roll by / and I roll with them / Centuries cry / Orders fly / and I fall again
Afford best design, implement best solution. Outsource your web design.


Last edited by quantum on Thu Sep 23, 04 2:58 am; edited 1 time in total
Thu Sep 23, 04 2:43 am
Back to top
quantum View user's profile Send private message Visit poster's website AIM Address
buzzby
Just In
Just In


Joined: 22 Sep 2004
Posts: 7

Post Post subject: Reply with quote

the name is BUZZBY not buzzboy.......makes me sound like a bee or wasp or something. no offense. cheers
Thu Sep 23, 04 2:50 am
Back to top
buzzby View user's profile Send private message
quantum
Site Admin
Site Admin


Joined: 07 Mar 2004
Posts: 1048
Location: Dhaka, Bangladesh

Post Post subject: Reply with quote

Oh gee...I am sorry man. I did not mean to offense you. I was not thinking in that direction. But now that you mentioned it, I am laughing so hard....I will definitely remember to call you B U Z Z B Y.
_________________

Dust fills my eyes / Clouds roll by / and I roll with them / Centuries cry / Orders fly / and I fall again
Afford best design, implement best solution. Outsource your web design.
Thu Sep 23, 04 3:01 am
Back to top
quantum View user's profile Send private message Visit poster's website AIM Address
buzzby
Just In
Just In


Joined: 22 Sep 2004
Posts: 7

Post Post subject: Reply with quote

Code:

if (isset($_POST['submit']))
{
$user="";
$host="localhost";
$password="";
$database="";
$connection = mysql_connect($host,$user,$password) or die ("could not connect to server");
$db = mysql_select_db($database,$connection);
$sql = "insert into gstrialforma(my_date, fname, lname, email, address1, address2, address3, mobile, workhometel, contactpostcode, projectpostcode, starterkit, surveykit, designkit, supportkit, costvaluekit, constructionkit, starterkitpack, designcostpack, drawingskitpack, permissionkitpack, doyouneed, designstyle, project, uses, engineer, partywall, architect, projectmanager, design, lifestyle, structural, planning, buildingregs, otherhelp, wheelchair, partialeyesight, terraced, familychildern, semidetached, aged, allergy, detached, other, otherneeds, specifyneeds, programtimecompletion, budgetcost, projectdeadline, whybuild, otherpreferences) values ('{$_POST['my_date']}','{$_POST['fname']}','{$_POST['lname']}','{$_POST['email']}','{$_POST['address1']}','{$_POST['address2']}','{$_POST['address3']}','{$_POST['mobile']}','{$_POST['workhometel']}','{$_POST['contactpostcode']}','{$_POST['projectpostcode']}','{$_POST['starterkit']}','{$_POST['surveykit']}','{$_POST['designkit']}','{$_POST['supportkit']}','{$_POST['costvaluekit']}','{$_POST['constructionkit']}','{$_POST['starterkitpack']}','{$_POST['designcostpack']}','{$_POST['drawingskitpack']}','{$_POST['permissionkitpack']}','{$_POST['doyouneed']}','{$_POST['designstyle']}','{$_POST['project']}','{$_POST['uses']}','{$_POST['engineer']}','{$_POST['partywall']}','{$_POST['architect']}','{$_POST['projectmanager']}','{$_POST['design']}','{$_POST['lifestyle']}','{$_POST['structural']}','{$_POST['planning']}','{$_POST['buildingregs']}','{$_POST['otherhelp']}','{$_POST['wheelchair']}','{$_POST['partialeyesight']}','{$_POST['terraced']}','{$_POST['familychildern']}','{$_POST['semidetached']}','{$_POST['aged']}','{$_POST['allergy']}','{$_POST['detached']}','{$_POST['other']}','{$_POST['otherneeds']}','{$_POST['specifyneeds']}','{$_POST['programtimecompletion']}','{$_POST['budgetcost']}','{$_POST['projectdeadline']}','{$_POST['whybuild']}','{$_POST['otherpreferences']}')";
$result = mysql_query($sql) or print(mysql_error());
$sql2 = "insert into users(fname, lname, username, password, email) values ('{$_POST['fname']}','{$_POST['lname']}','{$_POST['address1']}','{$_POST['address3']}','{$_POST['email']}')";
$result2 = mysql_query($sql2) or print(mysql_error());
//mail($to, $subject, $msg, $additional_headers);

mail('support@building-doctors.com','Contact Us Form','Hello Alex, you need to check your records as '.$_POST['name'].' whose email address is '.$_POST['email'].' has filled out the form. ', "From: webmaster@buildingdoctors.co.uk");
mail($_POST['email'],'Building Doctors','Hello '.$_POST['name'].', thank you for your enquiry on '.$_POST['my_date'].'. We will be following up your request shortly. You have said that: Your preferred Design Style is '.$_POST['designstyle'].'. Your approximate Construction Budget is £'.$_POST['budgetcost'].'. Please review the useful links about Professional and our Duty of care policy located at the bottom right of the site. In the meantime wait for our call. Regards, Building Doctor', "From: support@building-doctors.co.uk");
//mail('dmc@dcobbinah.co.uk','Filed in Form','Hello Chris, you need to check your records as '.$_POST['name'].' has filled out the form and has included credit card details. ', "From: sales@victoriafinejewellery.com");
//this mail proves that multiple mail settings can be made to send differing emails to different addresses while still including attributes from the submitted form
echo "<table border=1 cellpadding=2 cellspacing=2 class=biggertext><tr><td>";
echo "</tr></td><tr><td><img src=images/cr_header.gif></tr></td><tr><td>";
echo 'Hello '.$_POST['name'].', thank you for your enquiry on '.$_POST['my_date'].'.<br>We will be following up your request shortly. <br><br>You have said that: <br>Your preferred Design Style is '.$_POST['designstyle'].'. <br>Your approximate Construction Budget is £'.$_POST['budgetcost'].'.<br><br>Please review the useful links about Professional and our Duty of care policy located at the bottom right of the site. <p>In the meantime wait for our call. <p><p>Regards, <br>Building Doctor';
echo "</tr></td></table>";
echo "<body onLoad=redirect() text=#000000 link=#00FFFF vlink=#C0C0C0>";

}
elseif (isset($_POST['sendtoform'])) {
?>
<body leftmargin="0" topmargin="0" onload="MM_preloadImages('images/briefform_on.gif','images/detailedform_on.gif','images/step_back_on.gif')">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
this starts the table. the actual table can be seen here:
[http://www.buildingdoctors.co.uk] (click to enter the site) click SIGN UP the DETAILED FORM and you will see the form. this is the whole php script above. how do i put a 'attach file to email' script?
Thu Sep 23, 04 3:16 am
Back to top
buzzby View user's profile Send private message
quantum
Site Admin
Site Admin


Joined: 07 Mar 2004
Posts: 1048
Location: Dhaka, Bangladesh

Post Post subject: Reply with quote

Okay, thanks for posting the script. This will take some time to go through. But I think, I can fix that. No worries.
_________________

Dust fills my eyes / Clouds roll by / and I roll with them / Centuries cry / Orders fly / and I fall again
Afford best design, implement best solution. Outsource your web design.
Thu Sep 23, 04 3:20 am
Back to top
quantum View user's profile Send private message Visit poster's website AIM Address
buzzby
Just In
Just In


Joined: 22 Sep 2004
Posts: 7

Post Post subject: Reply with quote

that would be brilliant. if you could show me how to add a file then i can add the copmpany brochure to the email that will be sent out to people
Thu Sep 23, 04 3:25 am
Back to top
buzzby View user's profile Send private message
buzzby
Just In
Just In


Joined: 22 Sep 2004
Posts: 7

Post Post subject: Reply with quote

i left out an important piece of info. the attachemtn is to be sent out to people as an attachment to the confirmation mail they recieve. they are not attaching a file. its me that will be sending them a file with the confirmation
Thu Sep 23, 04 6:05 am
Back to top
buzzby View user's profile Send private message
quantum
Site Admin
Site Admin


Joined: 07 Mar 2004
Posts: 1048
Location: Dhaka, Bangladesh

Post Post subject: Reply with quote

Buzzby, it seems like I am too swamped with things to get around to your scripts. You can wait a few more days for me to get around to this script or you can just install a new email script.
_________________

Dust fills my eyes / Clouds roll by / and I roll with them / Centuries cry / Orders fly / and I fall again
Afford best design, implement best solution. Outsource your web design.
Sat Sep 25, 04 4:58 am
Back to top
quantum View user's profile Send private message Visit poster's website AIM Address
hasnut
Expert User
Expert User


Joined: 28 Aug 2004
Posts: 201

Post Post subject: Reply with quote

[http://www.hollowearth.co.uk/tech/php/email_attachments.php]

make sure your attatchment file much reside on your server. not from your machine. If you want to add from your machine then you need to upload it first. IF you need upload script just let me know.
_________________
Sarder Hasnut
MCSD, CIW A

Need Low Cost Prefessional Hosting Contact me
Tue Sep 28, 04 11:17 am
Back to top
hasnut View user's profile Send private message Visit poster's website MSN Messenger
nmtee
Just In
Just In


Joined: 20 Oct 2004
Posts: 1

Post Post subject: Reply with quote

Hi Buzzby,

now i can get your mean tthat you want your custormer to see your brochure when they get an auto-response email, right?

Well, i just want to talk beside technical thing. That you should have your brochure well-designed on the page, then let your customer re-direct to that page after they submit the form.

The reason for this is quite easy, that your custormer can have a chance to see and print your brochure if needed right away. and you can have a response or thank them here for convenient.

Otherwise, your custormer will have to check mail and download that attached email later and they might skip looking at the attachment, i mean the chances to see your brochure will be shortened.
Wed Oct 20, 04 10:09 pm
Back to top
nmtee View user's profile Send private message
hasnatme
Moderator
Moderator


Joined: 22 Aug 2004
Posts: 283
Location: Dhaka,Bangladesh

Post Post subject: Reply with quote

nmtee wrote:
Hi Buzzby,

now i can get your mean tthat you want your custormer to see your brochure when they get an auto-response email, right?

Well, i just want to talk beside technical thing. That you should have your brochure well-designed on the page, then let your customer re-direct to that page after they submit the form.

The reason for this is quite easy, that your custormer can have a chance to see and print your brochure if needed right away. and you can have a response or thank them here for convenient.

Otherwise, your custormer will have to check mail and download that attached email later and they might skip looking at the attachment, i mean the chances to see your brochure will be shortened.


I must agree with this comment and you can make both redirection and e-maill too.
_________________
Just Fly With Your Dreams!!!
Digital Vision
Thu Oct 21, 04 3:59 pm
Back to top
hasnatme View user's profile Send private message Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    dna88 Forum Index -> Web scripting language Discussion Forum All times are GMT - 7 Hours
Page 1 of 1

 

Partners and Resources

Bangladesh hosting company

Bangladesh web design

Driven by phpBB © phpBB Group