unplugged_web Posted July 9, 2008 Share Posted July 9, 2008 I have a form on a site that sends all of the information in an email, but I wanted to know if it was possible to have an automated email response sent to the person who filled out the form?Thanks Link to comment Share on other sites More sharing options...
Synook Posted July 9, 2008 Share Posted July 9, 2008 Why not? Just have another email call with the address they supplied in the to parameter. Link to comment Share on other sites More sharing options...
unplugged_web Posted July 9, 2008 Author Share Posted July 9, 2008 Why not? Just have another email call with the address they supplied in the to parameter.But I'd like to have a separate subject for the automated email, does that matter? Link to comment Share on other sites More sharing options...
Synook Posted July 9, 2008 Share Posted July 9, 2008 No, you can put anything you want in the subject parameter. mail($_POST['email'], "Thank you for contacting OurBusiness", "Blah", "From <thehappyappy@ourbusiness.com>\r\n"); Link to comment Share on other sites More sharing options...
unplugged_web Posted July 9, 2008 Author Share Posted July 9, 2008 No, you can put anything you want in the subject parameter.mail($_POST['email'], "Thank you for contacting OurBusiness", "Blah", "From <thehappyappy@ourbusiness.com>\r\n"); This is what I've got to send the information from the form:<?php$message = "Name: {$_POST['name']}\nEmail: {$_POST['email']}\nTelephone: {$_POST['telephone']}\nCurrent Job Title: {$_POST['current_job_title']}\nAddress: {$_POST['address']}\nCity: {$_POST['city']}\nPostcode: {$_POST['postcode']}\nCountry: {$_POST['country']}\nYour Name: {$_POST['your_name']}\nYour Email: {$_POST['your_email']}\n-fuser@ourbusiness.com";ini_set("sendmail_from", 'thehappyappy@ourbusiness.com');mail("thehappyappy@ourbusiness.com","contact via refer a friend form","$message");?> would I just add mail($_POST['email'], "Thank you for contacting OurBusiness", "Blah", "From <thehappyappy@ourbusiness.com>\r\n"); to the end of it?Also is it possible to specify a header as well as subject?Thanks Link to comment Share on other sites More sharing options...
Synook Posted July 9, 2008 Share Posted July 9, 2008 would I just addmail($_POST['email'], "Thank you for contacting OurBusiness", "Blah", "From <thehappyappy@ourbusiness.com>\r\n"); to the end of it? Yes, but as you set the from address in php.ini you don't need the from header. If you do want to add it I wrote it wrong it should be "From: thehappyappy <thehappyappy@ourbusiness.com>\r\n"Also is it possible to specify a header as well as subject?Yes, why not?mail($_POST['email'], "Thank you for contacting OurBusiness", "Blah", "Header1:value\r\nheader2:value\r\n"); Link to comment Share on other sites More sharing options...
unplugged_web Posted July 9, 2008 Author Share Posted July 9, 2008 Yes, but as you set the from address in php.ini you don't need the from header. If you do want to add it I wrote it wrong it should be "From: thehappyappy <thehappyappy@ourbusiness.com>\r\n"Yes, why not?mail($_POST['email'], "Thank you for contacting OurBusiness", "Blah", "Header1:value\r\nheader2:value\r\n"); Thanks, where do I specify what the header1 and header2 are? Link to comment Share on other sites More sharing options...
Synook Posted July 9, 2008 Share Posted July 9, 2008 Well, say you wanted to send content-type and reply-to headers, then you could do mail($_POST['email'], "Thank you for contacting OurBusiness", "Blah", "content-type:text/html\r\nreply-to:help@ourbusiness.com\r\n"); Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.