MyR Posted November 15, 2009 Share Posted November 15, 2009 Hello, I am using osCommerce 2.2 RC2. Problem: my web host only allows outgoing mail from my domain. I made the following change in contact_us.php to allow the form to function: ... $email = "customerservice@mydomain.com"; $email_address = tep_db_prepare_input($HTTP_POST_VARS['email']); $enquiry = tep_db_prepare_input($HTTP_POST_VARS['enquiry']); if (tep_validate_email($email_address)) { tep_mail(STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, EMAIL_SUBJECT, $enquiry, $name, $email); ... Of course when I receive the email, the customer's email address is not shown since I replaced it with mine. How can I add the customer's email address to the email header as a reply-to address? Thanks in advance! Link to comment Share on other sites More sharing options...
Xpajun Posted November 15, 2009 Share Posted November 15, 2009 You may find something to help you here My store is currently running Phoenix 1.0.3.0 I'm currently working on 1.0.7.2 and hope to get it live before 1.0.8.0 arrives (maybe 🙄 ) I used to have a list of add-ons here but I've found that with the ones that supporters of Phoenix get any other add-ons are not really neccessary Link to comment Share on other sites More sharing options...
MyR Posted November 15, 2009 Author Share Posted November 15, 2009 You may find something to help you here Thank you for your quick reply! That solution works but I'd still rather have the customer's reply-to address in the header if possible. Better than it was though. Curse my web host for trying to prevent spam! Adam Link to comment Share on other sites More sharing options...
multimixer Posted November 15, 2009 Share Posted November 15, 2009 Why not to have the customers address in the subject of the email? My community profile | Template system for osCommerce - New: Responsive | Feedback channel Link to comment Share on other sites More sharing options...
MyR Posted November 15, 2009 Author Share Posted November 15, 2009 Why not to have the customers address in the subject of the email? Ah I like that idea! Link to comment Share on other sites More sharing options...
multimixer Posted November 16, 2009 Share Posted November 16, 2009 Ah I like that idea! me too :) So, you need to do following, all in file contact_us.php ofcourse 1) make a new definition, ie "$subject" just before the tep_mal function like this $subject = EMAIL_SUBJECT . ' ' . $email_address; If you want you can have your mail without any other subject, just with the customers email 2) In the tep_mail function, you replace EMAIL_SUBJECT with the just defined $subject so that it looks like this tep_mail(STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, $subject, $enquiry, $name, $email_address); If you did already the changes like described in email issues post #2 , then your tep_mail function will look like this tep_mail(STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, $subject, $email_body, $name, $from_email); enjoy :) My community profile | Template system for osCommerce - New: Responsive | Feedback channel Link to comment Share on other sites More sharing options...
MyR Posted November 16, 2009 Author Share Posted November 16, 2009 Thank you very much for your help! This is a sufficient solution. I would still like to add the customer's reply-to email address to the email headers if possible! Thank you Link to comment Share on other sites More sharing options...
germ Posted November 17, 2009 Share Posted November 17, 2009 Thank you very much for your help! This is a sufficient solution. I would still like to add the customer's reply-to email address to the email headers if possible! Thank you BACKUP THE FILE. Then replace: if (tep_validate_email($email_address)) { tep_mail(STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, EMAIL_SUBJECT, $enquiry, $name, $email); With: if (tep_validate_email($email_address)) { $headers = 'From: ' . STORE_OWNER_EMAIL_ADDRESS . "\r\n" . 'Reply-To: ' . $email_address . "\r\n"; mail(STORE_OWNER_EMAIL_ADDRESS , EMAIL_SUBJECT , $enquiry , $headers, ''); It seemed to work for me. If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you. "Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice." - Me - "Headers already sent" - The definitive help "Cannot redeclare ..." - How to find/fix it SSL Implementation Help Like this post? "Like" it again over there > Link to comment Share on other sites More sharing options...
MyR Posted November 17, 2009 Author Share Posted November 17, 2009 I ended up using this: if (tep_validate_email($email_address)) { $headers = 'From: ' . $name . ' <' . STORE_OWNER_EMAIL_ADDRESS . ">\r\n" . 'Reply-To: ' . $email_address . "\r\n"; mail(STORE_OWNER_EMAIL_ADDRESS, EMAIL_SUBJECT, $enquiry, $headers, ''); Thanks again! Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.