Jyothi Posted May 17, 2007 Share Posted May 17, 2007 Hi I have a website that has feedback form, customers enter details and a php script sends the information to my email address. I would like this changing so that an automated response is sent to the customer to let them know we have received the information and will contact them shortly. I would like this email to contain the information we are sent so they can see if it contained any errors. The current PHP script that I am using is shown below: $name = $_REQUEST['name'] ; $address = $_REQUEST['address'] ; $postcode = $_REQUEST['postcode'] ; $telephone = $_REQUEST['telephone'] ; $email = $_REQUEST['email'] ; $brand = $_REQUEST['brand'] ; $productcode = $_REQUEST['productcode'] ; $voltage = $_REQUEST['voltage'] ; $quantity = $_REQUEST['quantity'] ; $pricequoted = $_REQUEST['pricequoted'] ; $info = $_REQUEST['info'] ; mail( "[email ADDRESS HERE", "Would like to Purchase", "Name: $name\n Address: $address\n Post Code: $postcode\n Telephone: $telephone\n Email: $email\n Brand: $brand\n Product Code: $productcode\n Voltage: $voltage\n Quantity: $quantity\n Price Quoted: $pricequoted\n Info: $info", "From: Website Order" ); header( "Location: www.qualitytoolsltd.co.uk/paymentthankyou.html" ); ?> I would like the automatic email response to include my company’s logo in the email; the logo is attached with this project post. Also i have a text that i want to sent it to mail. Please please let me know what changes should i include in my script to send the automated response!! Am really stuck in here. Any help is greatly appreciated!! Thanks in advance Regards Jyothi Link to comment https://forums.phpfreaks.com/topic/51774-alter-php-script-to-provide-automated-response/ Share on other sites More sharing options...
neel_basu Posted May 17, 2007 Share Posted May 17, 2007 Use 2 mail() one after another 1 to send it to you and another 1 to send to that person. Link to comment https://forums.phpfreaks.com/topic/51774-alter-php-script-to-provide-automated-response/#findComment-255082 Share on other sites More sharing options...
Jyothi Posted May 17, 2007 Author Share Posted May 17, 2007 How do i include the logo in the Email? Also i have some large text messages to be sent along with other data!. How do i do that? Please can you help me with the script? Link to comment https://forums.phpfreaks.com/topic/51774-alter-php-script-to-provide-automated-response/#findComment-255086 Share on other sites More sharing options...
neel_basu Posted May 17, 2007 Share Posted May 17, 2007 You need to send HTML MIME mails in that mail you need to keep <img src="image_location" /> Link to comment https://forums.phpfreaks.com/topic/51774-alter-php-script-to-provide-automated-response/#findComment-255088 Share on other sites More sharing options...
Jyothi Posted May 17, 2007 Author Share Posted May 17, 2007 Would the script look some thing like this :?? $name = $_REQUEST['name'] ; $address = $_REQUEST['address'] ; $postcode = $_REQUEST['postcode'] ; $telephone = $_REQUEST['telephone'] ; $email = $_REQUEST['email'] ; $brand = $_REQUEST['brand'] ; $productcode = $_REQUEST['productcode'] ; $voltage = $_REQUEST['voltage'] ; $quantity = $_REQUEST['quantity'] ; $pricequoted = $_REQUEST['pricequoted'] ; $info = $_REQUEST['info'] ; mail( "[email ADDRESS of the website owner here to send mail regarding purchase orders made by customers ", "Would like to Purchase", "Name: $name\n Address: $address\n Post Code: $postcode\n Telephone: $telephone\n Email: $email\n Brand: $brand\n Product Code: $productcode\n Voltage: $voltage\n Quantity: $quantity\n Price Quoted: $pricequoted\n Info: $info", "From: Website Order" ); header( "Location: www.xxxxxxxxxpaymentthankyou.html" ); ?> mail( "[email ADDRESS of the website owner here", "<img src="image_location" />", "msg.body" ); ?> mail( "[email ADDRESS of customers ", "<img src="image_location" />", "msg.body"); ?> Please look at it and let me know. Am new to php and trying to gain knowledge and expertise through work. All the help is appreciated. Link to comment https://forums.phpfreaks.com/topic/51774-alter-php-script-to-provide-automated-response/#findComment-255133 Share on other sites More sharing options...
jitesh Posted May 17, 2007 Share Posted May 17, 2007 if(mail( "[email ADDRESS of the website owner here to send mail regarding purchase orders made by customers ", "Would like to Purchase", "Name: $name\n Address: $address\n Post Code: $postcode\n Telephone: $telephone\n Email: $email\n Brand: $brand\n Product Code: $productcode\n Voltage: $voltage\n Quantity: $quantity\n Price Quoted: $pricequoted\n Info: $info", "From: Website Order" )){ // Send mail to userl mail('cust_email','sub' ..........); } header( "Location: www.xxxxxxxxxpaymentthankyou.html" )){ Link to comment https://forums.phpfreaks.com/topic/51774-alter-php-script-to-provide-automated-response/#findComment-255138 Share on other sites More sharing options...
Jyothi Posted May 17, 2007 Author Share Posted May 17, 2007 And where would i use the mail php function to send the mail to owner (same mail sent to customer, to verify if all the contents sent to customer are true)? I guess, i want to use the mail function just below the mail function used to send mail to customer? Link to comment https://forums.phpfreaks.com/topic/51774-alter-php-script-to-provide-automated-response/#findComment-255140 Share on other sites More sharing options...
jitesh Posted May 17, 2007 Share Posted May 17, 2007 mail('[email protected],[email protected]','sub','message','header'); Link to comment https://forums.phpfreaks.com/topic/51774-alter-php-script-to-provide-automated-response/#findComment-255142 Share on other sites More sharing options...
Jyothi Posted May 17, 2007 Author Share Posted May 17, 2007 In the mail () php function, i see the 'message' part takes just 70 characters. Is it possible to sent message more than that limit. Actually in the message part am looking for sending a long message (about 2-3 paragraphs)!! Can i use the script like this: <?php //The Message $message = "<p> Thank You for wishing to make a purchase from us. Our system has received your Order Request and it has been passed on to a member of our team. </p> <br> <p>If you have placed your order request during office hours (Monday to Friday, 9am to 5pm) then a member of our team shall be in contact with you shortly. If you have placed your Order Request outside of office hours then we shall contact you during the Next working day to process your order over the phone. Please be aware that if you did decide to place an order with another company now, then it is more than likely that they would not process the order until the next working day either.</p><br> <p>You can see below a copy of the information that has been sent to our team below:</p> $name = $_REQUEST['name'] ; $address = $_REQUEST['address'] ; $postcode = $_REQUEST['postcode'] ; $telephone = $_REQUEST['telephone'] ; $email = $_REQUEST['email'] ; $brand = $_REQUEST['brand'] ; $productcode = $_REQUEST['productcode'] ; $voltage = $_REQUEST['voltage'] ; $quantity = $_REQUEST['quantity'] ; $pricequoted = $_REQUEST['pricequoted'] ; $info = $_REQUEST['info'] ; <p>If any of the information is incorrect, or if you would like us to contact you at a convenient time, then please let us know by sending an email to with “ORDER CHANGE” in the subject title.</p> <br> <p>Thank you very much for contacting us, we will speak to you soon.</p> Kind Regards xxxxx " ; mail ('[email protected],[email protected]','sub', $message, 'header'); ?> Sorry to confuse at the last moment. My point here is , i want to send a long message in the email. How can i insert that! The message part might not have the entire syntax correct, i might have missed some of the html tags, but writted it to give the idea of what am trying to do. Please help Link to comment https://forums.phpfreaks.com/topic/51774-alter-php-script-to-provide-automated-response/#findComment-255182 Share on other sites More sharing options...
neel_basu Posted May 17, 2007 Share Posted May 17, 2007 Use mail() two times 1 after another. Link to comment https://forums.phpfreaks.com/topic/51774-alter-php-script-to-provide-automated-response/#findComment-255186 Share on other sites More sharing options...
jitesh Posted May 17, 2007 Share Posted May 17, 2007 You can send like this <?php // multiple recipients $to = '[email protected]' . ', '; // note the comma $to .= '[email protected]'; // subject $subject = 'Birthday Reminders for August'; // message $message = ' <html> <head> <title>Birthday Reminders for August</title> </head> <body> <p>Here are the birthdays upcoming in August!</p> <table> <tr> <th>Person</th><th>Day</th><th>Month</th><th>Year</th> </tr> <tr> <td>Joe</td><td>3rd</td><td>August</td><td>1970</td> </tr> <tr> <td>Sally</td><td>17th</td><td>August</td><td>1973</td> </tr> </table> </body> </html> '; // To send HTML mail, the Content-type header must be set $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; // Additional headers $headers .= 'To: Mary <[email protected]>, Kelly <[email protected]>' . "\r\n"; $headers .= 'From: Birthday Reminder <[email protected]>' . "\r\n"; $headers .= 'Cc: [email protected]' . "\r\n"; $headers .= 'Bcc: [email protected]' . "\r\n"; // Mail it mail($to, $subject, $message, $headers); Link to comment https://forums.phpfreaks.com/topic/51774-alter-php-script-to-provide-automated-response/#findComment-255187 Share on other sites More sharing options...
Jyothi Posted May 17, 2007 Author Share Posted May 17, 2007 Appreciate your help. Thanks for the replies. Will try this out today and check if it works as i intend. Once again appreciate the support provided! Link to comment https://forums.phpfreaks.com/topic/51774-alter-php-script-to-provide-automated-response/#findComment-255242 Share on other sites More sharing options...
Jyothi Posted May 18, 2007 Author Share Posted May 18, 2007 Thanks all for the help and support provided. Really appreciate your help. Link to comment https://forums.phpfreaks.com/topic/51774-alter-php-script-to-provide-automated-response/#findComment-256067 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.